baragan Posted November 11, 2012 Share Posted November 11, 2012 I have an issue with jquery. I have created a panel with 4 tabs each having its own id (e.g id="tab1" to id="tab4"). When i click lets say tab4 i goes to tab 4 without any issues. the panel is in the info page and this is how the link looks like when i move the mouse over it (info.html#tab4). Now my problem is when i try to load the link from another page lets say from the home page, instead of going to the 4th tab it loads the first how can i solve this or rather what can i do to make the browser catch the id and load the 4th tab instead of the first please help me out. Link to comment Share on other sites More sharing options...
DarkxPunk Posted November 11, 2012 Share Posted November 11, 2012 (edited) You would need the link to call the jquery which may be a problem if other people link to the tab.I would have document.onload check the URL and if #tab4 is present load jquery. Edited November 11, 2012 by DarkxPunk Link to comment Share on other sites More sharing options...
baragan Posted November 12, 2012 Author Share Posted November 12, 2012 Thanks darkx it worked though i had to use an if else statement to check the url then click the link with the corresponding id. Initialy i had it click the first link when the page loads. Now i have a very small issue with my method. Lets say the url is info.html#panel2, the page jumps to that id immidiately. Is there a way i can have it open the page normaly and that panel without necessarily jumping to that id? Link to comment Share on other sites More sharing options...
DarkxPunk Posted November 13, 2012 Share Posted November 13, 2012 Try: http://stackoverflow.com/questions/1489624/modifying-document-location-hash-without-page-scrolling Link to comment Share on other sites More sharing options...
baragan Posted November 13, 2012 Author Share Posted November 13, 2012 let me check it out. thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now