Is this JavaScript? -- if yes, how?

ajax , java , javascript Norway
  • 13 years ago

    Hi everyone, I am new here (and to JS too). Just one little question as I have been looking at it for a long time and would like to have it on my website as well.

    How to make the box like the one on http://www.msn.com/ that has different pages(layers) and you can click to see "Next" and "Previous" without having to load another page, and it seems to work quite fast. I believe this is JS but not really sure.

    Anybody has an answer or has an open source to recommend?  

    Many thanks for an answer.Smiley Face [:)]

    Chad

  • 13 years ago

    I think it used Ajax. ofcouse the javascript is the core of Ajax.....It's just for my own opinion...

  • 13 years ago
    Hey...I saw an example of Ajax on w3schools. Ive also seen a similar example on msn (not sure what page it is though!) where the page refreshes without the need for clicking a previous or next button. Check out Ajax, its ace :)

    http://www.w3schools.com/ajax/ajax_database.asp

    Hinx

  • 13 years ago

    yes ! nO dOubt. its AJAX aLL.

    GoogLe aLso use this technology fOr faster servive. Actualy its nOt a TechnoLogy. Its a kind Of teqniches used by the deveLopers mixing XML & Javascript tOgether.

    Thnx.

    http://bestlesson.50webs.com

  • 13 years ago
    Hi there,
    I think it's not Ajax. It's a simple JavaScript code.
    http://www.microsoft.com/en/us/default.aspx



  • 13 years ago

    Hi,

    Also am outdated in web development, I agree with Mehdi that this it is java script. I believe that it is done by adding all the pictures on the design of the page and then playing the game of show and hide. All the trick is in the navigation bar being used (next , previous).

    After all, it is clever and I will be furtherly checking it.

  • 13 years ago

    Hi,

    Check this code, just copy it to an empty page and change the pictures source (you may add another pictures as options of the combo box).

    <script language="javascript">

    var x = 0;

    function rotate(num){
    x=num%document.slideForm.slide.length;
    if(x<0){x=document.slideForm.slide.length-1};
    document.images.show.src=document.slideForm.slide.options[x].value;
    document.slideForm.slide.selectedIndex=x;}



    function apRotate() {
    if(document.slideForm.slidebutton.value == "Stop"){
    rotate(++x);window.setTimeout("apRotate()", 5000);}}
    </script>


    <form name="slideForm">
    <table cellspacing=1 cellpadding=4 style="border:1px black solid; border-collapse:collapse">
    <tr><td align=center>
    <b>Pictures of my work</b>
    </td></tr>



    <tr><td align=center width=200 height=150>
    <img src="
    file:///C:/Graphics/logo.gif"

    name="show" width="90" height="107">
    </td></tr>

    <tr><td align=center style="border:1px black solid;">
    <select name="slide" onChange="rotate(this.selectedIndex);" visible=False>
    <option value="

    file:///C:/Graphics/logo.gif"

    selected>pic1
    <option value="
    pic2'>file:///C:/Graphics/lab12.jpg">pic2
    </select>
    </td></tr>

    <tr><td align=center style="border:1px black solid;">
    <input type=button onclick="rotate(0);" value="ll&lt;&lt;" title="Jump to beginning"

    style="border:1px black solid;">
    <input type=button onclick="rotate(x-1);" value="&lt;&lt;" title="Last Picture"

    style="border:1px black solid;">
    <input type=button name="slidebutton" onClick="this.value=

    ((this.value=='Stop')?'Start':'Stop');apRotate();" value="Start" title="Autoplay"

    style="width:75px; border:1px black solid;">
    <input type=button onclick="rotate(x+1);" value="&gt;&gt;" title="Next Picture"

    style="border:1px black solid;">
    <input type=button onclick="rotate(this.form.slide.length-1);" value="&gt;&gt;ll" title="Jump

    to end" style="border:1px black solid;">
    </td></tr></table></form>

     

    Hope this works for you.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity.” - Dennis Ritchie