To obtain your registration code, please send an email to [email protected]
Thread Rating:
  • 9 Vote(s) - 3.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Help with PHP/Javascript

1
Hi, someone can Help me with my website ? I have a problem with Javascript and PHP. I have a problem with hiding table in a foreach function.

Thanks
Thanks given by:
2
You can hide the table with jQuery.
http://api.jquery.com/hide/
Thanks given by: Lunacy
3
(06-03-2017, 06:59 PM)DerBerliner2015 Wrote: You can hide the table with jQuery.
http://api.jquery.com/hide/

Hi, thanks for you reply. My hide function work, but only on one table.
Look at this code, maybe you'll better understand what is the problem:
PHP Code:
<script> function visibilite(thingId) { var targetElement; targetElement = document.getElementById(thingId) ; if (targetElement.style.display == "none") { targetElement.style.display = "" ; } else { targetElement.style.display = "none" ; } } </script> <?php } echo "<h3>".$category->name."</h3>"; ?> <a href="javascript:visibilite('model');"><img src="<?php echo z_taxonomy_image_url($category->term_id); //*** recupere l'image par category ***// ?>" /> </a> <?php //*** category description ***// $cat_description=$category->description; //echo $cat_description; $slug=$category->slug; $args = array( 'tax_query' => array( array( 'taxonomy' => 'car-list', 'field' => 'slug', 'terms' => $slug, ) ), 'posts_per_page'=>100, 'orderby'=>'menu_order', 'order'=>'DESC' ); $my_query = new WP_Query( $args); if ( $my_query->have_posts() ) : while ( $my_query->have_posts() ) : $my_query->the_post(); $thePostID = $post->ID; $image = get_post_thumb($thePostID,54,54,"menu_item_slider"); $image_hover = get_post_thumb($thePostID,180,180,"menu_item_slider_hover"); $price=get_post_meta($thePostID, THEME_NAME.'_price', true); $description=get_post_meta($thePostID, THEME_NAME.'_description', true); if(!$price) $price=0; $currency=get_option(THEME_NAME.'_currency_category'); ?> <div id="model" style="display:none;"> <table class="item"> <tr> <td class="image"><a href="<?php the_permalink(); ?>" class="tTip" title="&lt;img src=&quot;<?php echo $image_hover['src'];?>&quot; alt=&quot;&quot; width=&quot;180&quot; height=&quot;180&quot; /&gt;"><img src="<?php echo $image['src'];?>" alt="" width="54" height="54" /></a></td> <td class="text"> <p class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p> <p class="description"><?php echo remove_html_slashes($description);?></p> </td> <td class="menu-price"><p><?php echo $currency.remove_html_slashes($price);?></p></td> </tr> </table> </div> <?php endwhile; else: endif; $n++; if($n==5) { $n=1; } }//end if } // end foreach ?> <!-- END .right-side --> </div>[/php]
Thanks given by:
4
Wordpress?
Thanks given by:
5
(06-03-2017, 07:28 PM)DerBerliner2015 Wrote: Wordpress?

Yes
Thanks given by:
6
Solved ! Thanks
Thanks given by:
Users browsing this thread: