简体   繁体   中英

How to add an additional hyperlink to Javascript tabify link?

I am using some JavaScript to create a retained hover over effect and to use tabs.

Here is an example of what I am doing here - http://jsfiddle.net/kU9NY/

What I would like to do is add a link to each of these tabs. Basically the user gets a preview of the page in the tab and then by clicking on one of the tabs it will take them to the full page.

I am not sure if this can be done as the links are already taken up by the tabs.

eg

<a href="#Booking">BOOKINGS</a> 

Can I add an additional linksome how or is there some JavaScript wizardry I can implement?

Many Thanks!!

You can add an onclick event on the anchor tag and use window.location to redirect

<a href="#Booking" onclick="window.location='http://www.google.com'">BOOKINGS</a>

Hope this helps.

You could probably do something like this: http://jsfiddle.net/kU9NY/14/

However, there might be an even easier way if you have an easier time setting the url other places, this is just a suggestion to get your brain going :)

of course you'd have to do one without the remove() in your onload

You could also set the link text in an data-linktext attribute and make that interchangable as well.

The same code with a wrapping function: http://jsfiddle.net/kU9NY/16/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM