Home > DeveloperSection > Forums > Jquery Tabs not working within the cycle for
Pravesh Singh
Pravesh Singh

Total Post:101

Posted on    August-16-2013 6:44 AM

 JQuery JQuery 

 1 Reply(s)
 886  View(s)
Rate this:
Hi developers!

This is my code: -script:


       $(function() {

       $( "#tabs" ).tabs();










        echo "<div id=\"tabs\" width=\"590px\">";

        echo "<ul><li>";

        echo "<a href=\"#tabs-\".$i> $name </a>";

        echo "</li>";

        echo "</ul>";

        echo "<div id=\"tabs-\".$i>


            </div> ";      


  echo "</div>";

this code is only generating the first tab. I do not know how to solve. can you help me?

Vijay Shukla

Total Post:100

Posted on    August-19-2013 3:24 AM

I notice a problem with the generated HTML:

echo "<a href=\"#tabs-\".$i> $name </a>";

echo "</li>";

echo "</ul>";

echo "<div id=\"tabs-\".$i>

Would result in the following HTML:

<a href="tabs-"1>Name</a>



<div id="tabs-"1>...

Notice how the id's are "tabs-"[Number] as opposed to "tabs-[Number]". Same problem with the href. This might be it or at least part of it.

Don't want to miss updates? Please click the below button!

Follow MindStick