Responsive Tabs / Posts /

External Page Links Dont Work

0
I have followed your troubleshooting protocol and have made a perfectly clean page using your demo1.html page and no additional jquery.

If I link into a mctab page from an external page, such as this:
http://www.bishopodowd.org/dev/mctabs/
The links don't take me to the top of the tabs. They take me to a random location in the tabs. Persist is set to false.

The anchor link from that page also doesn't work.

As best as I can determine McTab only works when linked to from within the same page.

Donovan R  10 years ago   viewed: 4028    

4 Answers

0
Did you consider the data-scroll parameter. You can read the online documentation and use that parameter to decide if you need to scroll to the target.
Milo   10 years ago
0
OMG. That's a hack, but it worked. 

The code should automatically make all links have a data-scroll of 0. It took me three days of messing with this to figure out that you have to EXPLICITLY state on every link that data-scroll is 0.  If you don't then it scrolls to a random location in the code. It would only scroll to the correct location on Tab 1. Otherwise all bets were off.
 
None of my external links worked properly until I did this.   At the very least, this should be in big bold letters in the documentation.

This is the link format that made external links finally scroll to the correct location:
http://www.bishopodowd.org/dev/mctabs/demo1.php#tab3?data-scroll=0

http://www.bishopodowd.org/dev/mctabs/demo1.php#anchor3?data-scroll=0

Thanks Milo.
Donovan R   10 years ago
0

It seems you dislike the default data-scroll value: 50px. We set this 50px so that the target will not be too close to the window top edge.

If you prefer the default value to be 0, you can open the javascript-tabs.js with Notepad, and you will find at the beginning:

var tabbers=function(){var offset=50,delay=50,...

You just need to change the offset=50 to offset=0

Milo   10 years ago
0
This variable was already set in the javascript page.

I had this variable already set in the jquery file. It didn't help.

Putting the data-scroll paramater in the link solved the issue with the Jquery scrolling to the bottom of the tab rather than the top.  But that should just work. This seems like a big bug or makes me wonder what I'm doing wrong. If I link to the tab from an external page it should go to the top of that content.  It appears to when you don't have much content, but when you have a huge tab it makes a big difference.

Donovan   10 years ago

   

Your name*
Password
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: