www.webdeveloper.com
Results 1 to 3 of 3

Thread: How can I deep link to a panel in a show/hide set up from another page?

  1. #1
    Join Date
    Aug 2013
    Posts
    2

    How can I deep link to a panel in a show/hide set up from another page?

    Here is a short code example of the scenario:

    http://jsfiddle.net/sXqnD/15/

    I need to be able to directly link from another page to one of the divs in the show/hide set up. So when the page loads, the div that was linked to (for example, #link2content) will be displayed. I've tried all I know and have looked everywhere for an answer. Is it even possible? Thanks for any help you can give.

  2. #2
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,112
    You'll want to get the hash value.
    http://stackoverflow.com/questions/2...ing-javascript

    Let's say you pass in link1, link2, or link3 like this:

    www.whatever.com/page.html#link1

    You'd run some javascript to get the hash value of link1. Then you'd run your jQuery to click the link 1 action.

    Code:
    // hashtag value is equal to link1
    hashtag = '#' hashtag; // adding the # to target the ID
    $(hashtag).click(); // same as $('#link1').click();
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  3. #3
    Join Date
    Aug 2013
    Posts
    2
    This was exactly right. I got it working. Thanks for the response!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles