Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2009
    Posts
    12
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Arrow javascript link not working in firefox

    Hi I have a numbered image gallery which has a next and previous link which is another way of navigating through the gallery the problem i have that in IE all is fine but doesnt seem to be working in firefox, i would appreciate afew pointers,
    regards.

    here is the code

    <script type="text/javascript">
    var currentImage = 1;

    function LoadGallery(picNum, captionText)
    {
    var footer = document.getElementById("footer");
    // get the array of all <a> elements in the footer:
    var links = footer.getElementsByTagName("a");
    // and unclick (change color back to normal) of the current link:
    links[currentImage].style.color = "#ffffff";

    // then change which is current image
    currentImage = picNum; // save current picture number
    // and change color of new current link:
    links[currentImage].style.color = "#ff9900";

    // rest the same
    var picture = document.getElementById("childhood_drawings");
    if (picture.filters)
    {
    picture.style.filter="blendTrans(duration=1)";
    picture.filters.blendTrans.Apply();
    }
    picture.src = "../images/childhood_drawings/" + picNum + ".jpg";
    if (picture.filters)
    {
    picture.filters.blendTrans.Play();
    }
    document.getElementById("topbar").innerHTML = captionText;

    return false; // cancel the click
    }

    function moveBy(what)
    {
    // where is user asking us to move to??
    var moveTo = currentImage + what;
    if ( moveTo < 1 || moveTo > 20 ) return; // can't move too far left or right

    var footer = document.getElementById("footer");
    // get the array of all <a> elements in the footer:
    var links = footer.getElementsByTagName("a");
    // and then click on that link:
    links[moveTo].click( );

    return false; // cancel the click
    }
    </script>

    and these are the links that dont work

    <a href="#" onclick="return false moveBy(-1)">&lt;</a>
    <a href="#" onclick="return false moveBy(+1)">&lt;</a

  • #2
    Banned
    Join Date
    Nov 2008
    Location
    not found
    Posts
    284
    Thanks
    0
    Thanked 53 Times in 51 Posts
    and these are the links that dont work

    <a href="#" onclick="return false moveBy(-1)">&lt;</a>
    <a href="#" onclick="return false moveBy(+1)">&lt;</a
    Incorrect syntax. The function returns false, so use: <a href="#" onclick="return moveBy(-1)">&lt;</a>

  • #3
    New Coder
    Join Date
    Apr 2009
    Posts
    12
    Thanks
    4
    Thanked 0 Times in 0 Posts

    still not working

    its still not working its strange that the numbered links work in both browsers but not the back and next links, any ideas anybody????


  •  

    Tags for this Thread

    Posting Permissions

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