Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorlondonstone
    • CommentTimeAug 31st 2007 edited
     permalink
    Hi all,
    This is my first post on this forum. I hope this topic is in the right place, it could be considered browser specific, but I figured it was more of a javascript problem. Let me explain...

    I have a page that uses Jquery to hide some divs until a user clicks on their heading. http://firstaid.medden.co.uk/courses

    The headings have id's like this....

    <h3 id="course2">Course 2 - click here for details</h3>

    Now normally I could make a link such as <a href="/courses/?phpMyAdmin=4594f30712f4fabaff6997416810f3f2#course2"> Go to course 2 the # part would take the user to the correct part of the page. However because Jquery is hiding the data until a user clicks the heading, in my case the course details don't show up.

    My first question is, is there any way to force the div under the linked course e.g. #course2 to display without the user clicking?

    My second question is, Firefox seems to position the user way down the page. It treats it like all the text was being displayed, and thinks that where the link should be. Obviously having a link to a blank part of the page isn't much use. Is there anyway I can tell firefox to behave.

    Here is a link that should take you to course 2 http://firstaid.medden.co.uk/courses/#course2

    Thanks in advance for anyone who kindly helps out.
  1.  permalink
    I have managed to sort out question one.
    I used the following javascript...

    if (window.location.hash){
    var anchr= window.location.hash;
    anchr = '.coursetitle' + anchr;
    $(anchr).next('div').show();
    var el = document.getElementById('course6');
    el.scrollIntoView(true);
    }

    Still got no idea how to stop firefox scrolling to the bottom of the page though.
Add your comments
    Username Password
  • Format comments as (Help)