jquery - td data-spy is not working dinamically created html in table -
i have product feature comparison chart product image. using jquery ajax request generate comparison html.
some time there lot of rows showing comparison features, time need hold product image in top of page. using data-offset-top="98" data-spy="affix"
attribute.
this html work when using it's static html. if use dinamic html it's not apply data-spy attribute when scroll down page.
please see static html design
<table class="responsive tablecontenttable " width="100%" border="0" cellspacing="0" cellpadding="10"> <thead> <tr> <td class="fixedtablerow" data-offset-top="98" data-spy="affix"> <ul class="col-xs-12 col-sm-12 col-md-12 col-lg-12 nav"> <li> <img src="images/product1.jpg" height="" width="" /> </li> <li> <p>15 inch macbook pro retina displaymgxa2ll/a.</p> </li> </ul> </td> <td class="fixedtablerow2" data-offset-top="98" data-spy="affix"> <ul class="col-xs-12 col-sm-12 col-md-12 col-lg-12 nav"> <li> <img src="images/product1.jpg" height="" width="" /> </li> <li> <p>15 inch macbook pro retina displaymgxa2ll/a.</p> </li> </ul> </td> </tr> </thead> <tbody> <tr id="feature2" class="featureheadingrow"> <td colspan="3" class="featureheading"> feature group 2</td> </tr> <tr class="featureheadrow"> <th valign="top" colspan="2"> price </th> </tr> <tr> <td> <label class="spec_content">$999</label> </td> <td> <label class="spec_content">$999</label> </td> </tr> <tr class="featureheadrow"> <th valign="top" colspan="2"> processor type </th> </tr> <tr> <td> <label class="">intel core i5</label> </td> <td> <label class="">intel core i5</label> </td> </tr> <tr class="featureheadrow"> <th valign="top" colspan="2"> hard drive </th> </tr> <tr> <td> <label class="">500gb</label> </th> <td> <label class="">500gb</label> </td> </tr> <tr class="featureheadrow"> <th valign="top" colspan="2"> msrp </th> </tr> <tr> <td> <label class="">$999</label> </td> <td> <label class="">$999</label> </td> </tr> <tr class="featureheadrow"> <th valign="top" colspan="2"> release year </th> </tr> <tr> <td> <label class="">2015</label> </td> <td> <label class="">2015</label> </td> </tr> <tr class="featureheadrow"> <th valign="top" colspan="2"> os version </th> </tr> <tr> <td> <label class="">os x 10.10 yosemite</label> </td> <td> <label class="">os x 10.10 yosemite</label> </td> </tr> <tr class="featureheadrow"> <th valign="top" colspan="2"> display technology </th> </tr> <tr> <td> <label class="">led</label> </td> <td> <label class="">led</label> </td> </tr> <tr class="featureheadrow"> <th valign="top" colspan="2"> resolution </th> </tr> <tr> <td> <label class="">2880*1800</label> </td> <td> <label class="">2880*1800</label> </td> </tr> </tbody> </table>
but when generate code server side ( c# ) data-spy attribute not
working .
could please suggest advice ?
thanks.
Comments
Post a Comment