Tab links to articles

  • fitzbeck
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
11 years 6 months ago #29971 by fitzbeck
Hi There, my users are clicking on the tabs and expecting to go directly to that article, rather than having the tabs load the image/text and then having to click the image/text link ...

Is it possible to set the tab link to load the article (or read more link) rather than load the rotating image/text ...

I tried to change the tmpl.php file with:
Code:
<a href="#fragment-<?php echo $loop; ?>">

with
Code:
<a href="<?php echo $link[$loop]; ?>"

which failed.

Any pointers would be awesome. Many thanks

Please Log in to join the conversation.

More
11 years 6 months ago #29981 by ivan.milic
Replied by ivan.milic on topic Tab links to articles
Change it to this:
Code:
<a href="#fragment-<?php echo $loop; ?>" link="<?php echo $link[$loop]; ?>" >

then add this javascript

<script>
jQuery(window).load(function(){
jQuery('a[link]').click(function(event){
e.preventDefault();
window.location = jQuery(this).attr('link');
});
});
</script>

Please Log in to join the conversation.

  • fitzbeck
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
11 years 6 months ago #30038 by fitzbeck
Brilliant - many thanks Ivan. Worked a treat.

please note i did add an 'e' to the JS function for it to work:
Code:
<script> jQuery(window).load(function(e){ jQuery('a[link]').click(function(event){ e.preventDefault(); window.location = jQuery(this).attr('link'); }); }); </script>

Please Log in to join the conversation.

More
11 years 6 months ago #30048 by ivan.milic
yes sorry for missing e, glad you sow it, thank you

Please Log in to join the conversation.

Time to create page: 0.159 seconds
Powered by Kunena Forum