Jump to content

showing Description in tabs


willrose84
 Share

Recommended Posts

I have made a set of 3 tabs in Java but I cant show the product description in one of then I call the js with this line at the top of product.tpl

[removed][removed]



the code in this is as follows

>
var tabs = [
               //first tab
               [
                   //tab image when unselected
                   'http://krisp.willrosesolutions.co.uk/Final/themes/blackwhite/img/information-hover.png',
                   //tab image when selected
                   'http://krisp.willrosesolutions.co.uk/Final/themes/blackwhite/img/information-selected.png',
                   //tab data
                   '{$product->description_short}'],
               //second tab
               [
                   'http://krisp.willrosesolutions.co.uk/Final/themes/blackwhite/img/delivery-hover.png',
                   'http://krisp.willrosesolutions.co.uk/Final/themes/blackwhite/img/delivery-selected.png',
                   '
Delivery Inf'],
               //third tab
               [
                   'http://krisp.willrosesolutions.co.uk/Final/themes/blackwhite/img/returns-hover.png',
                   'http://krisp.willrosesolutions.co.uk/Final/themes/blackwhite/img/returns-selected.png',
                   '
Returns Info']];
               //you can have more tabs if you want

//if you have empty space between your tabs, adjust this to a lower number
var width = 10;

function preloadImages() {
   for (var y = 0; y < 2; y++) {
       for (var x = 0; x < tabs.length; x++) {
           image = new Image();
           image.src = tabs[x][y];
       }
   }
}

function drawTabs() {
   [removed]("</pre>
<table cellspacing="0" cellpadding="0" border="0">");
   [removed](tabs[0][2]);
   [removed]("</table>");<br>   document.images["tab0"].src = tabs[0][1];<br>}<br><br>function switchTab(tab) {<br>   for (var x = 0; x < tabs.length; x++) {<br>       if (x != tab)<br>           document.images["tab"+x].src = tabs[x][0];<br>   }<br>   document.images["tab"+tab].src = tabs[tab][1];<br>   document.getElementById("currentTab")[removed] = tabs[tab][2];<br>}<br><br>preloadImages()



Any help you could give me would be great

Thanks in advance

Will

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More