Hello,
I have made some progress, the problem arises with the database driven items as i cant repeat the function for each item...
I use a recordset loop to write my Product divs..
Code:
animatedcollapse.addDiv('Events', 'fade=0,speed=400,group=pets,persist=1,hide=1')
animatedcollapse.addDiv('Videos', 'fade=0,speed=400,group=pets,hide=1')
<?php do { ?>
animatedcollapse.addDiv('Products<?php echo $row_Recordset_get_menu_java_cat['product_cat_id']; ?>', 'fade=0,speed=400,group=pets,hide=1')
<?php } while ($row_Recordset_get_menu_java_cat = mysql_fetch_assoc($Recordset_get_menu_java_cat)); ?>
Now Events and Videos work perfectly, but products are always shown...
Code:
animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
//$: Access to jQuery
if (divobj.id=="Products<?php echo $row_Recordset_get_menu_java_cat['product_cat_id']; ?>"){
if (state=="block")
$('#ProductDiv<?php echo $row_Recordset_get_menu_java_cat['product_cat_id']; ?>').show()
else
$('#ProductDiv<?php echo $row_Recordset_get_menu_java_cat['product_cat_id']; ?>').hide()
}
if (divobj.id=="Events"){
if (state=="block")
$('#EventsDiv').show()
else
$('#EventsDiv').hide()
}
if (divobj.id=="Videos"){
if (state=="block")
$('#VideosDiv').show()
else
$('#VideosDiv').hide()
}
//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
//state: "block" or "none", depending on state
}
animatedcollapse.init()
I need to somehow get the
Code:
if (divobj.id=="Products<?php echo $row_Recordset_get_menu_java_cat['product_cat_id']; ?>"){
if (state=="block")
$('#ProductDiv<?php echo $row_Recordset_get_menu_java_cat['product_cat_id']; ?>').show()
else
$('#ProductDiv<?php echo $row_Recordset_get_menu_java_cat['product_cat_id']; ?>').hide()
}
inside my loop without repeating the entire function over and over again... am i making sense?
Bookmarks