SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot LORDGreg's Avatar
    Join Date
    May 2001
    Location
    Ptuj, Slovenia
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how is this possible???

    i was registering a screen name on my.aol.com because a friend of mine said i will be surprised what that coders did. in our country we don't know aol,.. well you can see their commercials on other speaking channels on cable but that's it.. anyways... here's the surprising part:

    they have a drag and drop menus there made with a "little" help of javascript and dhtml (they're awesome!!!). well.. yes,.. you can say "i can grab their code", but wait.. there's more. after you drag&drop a menu on to different position the scripts save it's position somewhere (maybe a database on their server or something). if you're interested in weather in other country, you simple add/remove a country from a list and it reloads data and saves it into weather windows etc etc..

    now,.. i didn't mentioned but,.. everything happens without any refreshing the site or "click here" links to to that. all that refreshes is that dhtml window where text is.

    now i have a few questions:

    1. how is possible to retrieve different text from what you choosed without refreshing the page?

    2. is that maybe a hughe php&javascript mixing?

    3. i still don't understand, how can you retrieve a new text with javascript if it is clientside scripting???

    4. how can be the new placement of menu with jscript saved into sql db with a help of php

    if anyone knows the answer for this questions please answer it. if you have any tutorial where can i find how to do a thing like that please give me url or something.

    if you want to be impressed you MUST sign in my.aol.com (get yourself a new screenname) and check it for yourself. if you're not registered you just get the alert "please sign in".. YOU WON'T BE SORRY..

    please help..

    thank you very much and best regards
    lordgreg, sloreactor.com
    http://www.sloreactor.com/

  2. #2
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can load the html from a certain page into the layer itself. Here's a slightly old, but good, tutorial on it: http://www.dansteinman.com/dynduo/en/source.html
    ck :: bringing chris to the masses.

  3. #3
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it was a combination of php and javascript which it sounds like it might be. It could be done a couple of ways.

    Are you sure there isn't an iframe in there. It could be retrieving the data but if it isn't that then a simple layers script would do wonder for that. Load all data into different layers labelled in their own way. When a link or whatever is clicked it would simply 'replace' the old HTML with the new. Since everyting has already been loaded in the layers there is no need for a refresh
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  4. #4
    SitePoint Zealot LORDGreg's Avatar
    Join Date
    May 2001
    Location
    Ptuj, Slovenia
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you show me the example script for

    "When a link or whatever is clicked it would simply 'replace' the old HTML with the new"

    how to replace that?
    lordgreg, sloreactor.com
    http://www.sloreactor.com/

  5. #5
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by LORDGreg
    can you show me the example script for

    "When a link or whatever is clicked it would simply 'replace' the old HTML with the new"

    how to replace that?
    You can check out my web page. As long as you have IE 5.5+ or Netscape 6+ it will work fine. The basic code is this

    in the body have this layer tag
    Code:
    <div id="bob">
    This is the 'base' layer for which everything will be interchanged.
    </div>
    in the head have this function
    Code:
    function change_layer(layerid){
        document.getElementById('bob').innerHTML=document.getElementById(layerid).innerHTML
    }
    then you layer which can be loaded from info in the php/mysql combo like so

    Code:
    <div id="menu1" style="display: none">
    this is menu 1
    </div>
    So now we have the base layer, the function to allow it to change and the hidden layer that is basically used like a storage vessel - now for the link to activate

    Code:
    <a href="javascript:void(0)" onclick="change_layer('menu1')">link</a>
    Thats the gist of it. I use that on almost anything I design. There are ways to make it better for cross browser compatible but it is almost time for me to crash and I think you get the idea. Best of luck. as for tutorials look for vincent online. He is another user but has some primo toots on layers and such
    http://members.aol.com/grassblad/





    }
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  6. #6
    SitePoint Zealot LORDGreg's Avatar
    Join Date
    May 2001
    Location
    Ptuj, Slovenia
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    woohooo...

    i think we're on good way to end this. now, i decided other text won't be in the same file, like you have. let me explain:

    you have:
    - all text in one file. when you want other text to apear you just hide one id and show other in that content id.

    i have:
    - when i click an url to get new text it will take the text from other file (which i choose) and load it in iframe and then put it into that layer where i want my text to apear.

    everything works fine BUT...

    1. every file should have the same jscript in it (thats more complain than bothering stuff)
    2. when i load a file into a layer it looks great but that thing in MSIE (loading page, please wait...) is anoying and shows one percent of loaded page and it looks like the page isnt completely loaded, how to fix that???

    my files are:

    index.html
    Code:
    <html>
    <head>
    
      <title>movemenus by gregor</title>
    
      <script type="text/javascript">
      <!--
      ns4 = (document.layers)? true:false
      ie4 = (document.all)? true:false
    
      function loadsource (id, nestref, url) 
      {
        if (ns4) 
        {
          var lyr = (nestref)? eval('document.'+nestref+'.document.'+id) : document.layers[id]
          lyr.load(url,lyr.clip.width)
        }
        
        else if (ie4) 
        {
          parent.buffer.document.location = url
        }
      }
      
      function loadSourceFinish(id) 
      {
        if (ie4) document.all[id].innerHTML = parent.buffer.document.body.innerHTML
      }
    
      function menu_change (idname, menuname) 
      {
        document.getElementById(menuname).innerHTML = document.getElementById(idname).innerHTML
      }
      -->
      </script>
    </head>
    
    <body>
    <h4>Just testing the official movemenus</h4>
    
    
    <iframe style="display:none" name="buffer"></iframe>
    
    <iframe id="menu_1" style="display: none" src="about:blank"></iframe>
    
    <a href="javascript: menu_change('anothertext', 'menu_1_content')">Change text</a>
    <br /><br />
    
    <a href="javascript: loadsource('menu_1_content', null, 'test1.html)">Load source text #1</a>
    <br />
    <a href="javascript: loadsource('menu_1_content', null, 'test2.html')">Load source text #2</a>
    
    <br /><br />
    <center>
    
    <table width="760" border="1">
    <tr>
      
      <td id="col_1" width="48%">
    
        <table width="100%" border="0" cellspacing="1" cellpadding="0">
        <tr>
          <td style="line-height: 14px;">*
            <b>title 1</b>
          </td>
        </tr>
        </table>
      
        <table width="100%" border="0" cellspacing="1" cellpadding="1">
        <tr>
        <td bgcolor="#cdcdcd">
          <table width="100%" border="0" cellspacing="0" cellpadding="2">
          <tr>
          <td id="menu_1_content" bgcolor="#ffffff">
            blah blahblah<br />
    
            wooohooo
          </td>
          </tr>
          </table>
        </td>
        </tr>
        </table>
      
      
      </td>
    
      
      <td width="4%">
      
      </td>
      
      <td id="col_2" width="48%" valign="top">
      column 2
      </td>
    </tr>
    
    </table>
    
    </center>
    
    <div id="anothertext" style="display: none; width: 300px">
      foobar:P
    </div>
    
    </body>
    </html>

    test1.html & test2.html
    Code:
    <HTML>
    <HEAD>
    <TITLE>Content Page</TITLE>
    </HEAD>
    
    <BODY onLoad="parent.loadSourceFinish('menu_1_content')">
    
    insert some crapy text here... :P
    
    </BODY>
    </HTML>
    now, any suggestions how to get rid of "please wait, page still loading..." stuff???

    thank you again.. thanks all.. happy new year to all!!!
    lordgreg, sloreactor.com
    http://www.sloreactor.com/


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •