|
Help with PHP/Javascript - Printable Version +- MHH AUTO (https://mhhauto.com) +-- Forum: Suggestion, Selling & Damaged Links Box (https://mhhauto.com/Forum-Suggestion-Selling-Damaged-Links-Box) +--- Forum: Gossip Forum. (https://mhhauto.com/Forum-Gossip-Forum) +--- Thread: Help with PHP/Javascript (/Thread-Help-with-PHP-Javascript) |
Help with PHP/Javascript - Lunacy - 06-03-2017 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 RE: Help with PHP/Javascript - DerBerliner2015 - 06-03-2017 You can hide the table with jQuery. http://api.jquery.com/hide/ RE: Help with PHP/Javascript - Lunacy - 06-03-2017 (06-03-2017, 06:59 PM)DerBerliner2015 Wrote: You can hide the table with jQuery. 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="<img src="<?php echo $image_hover['src'];?>" alt="" width="180" height="180" />"><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]
Help with PHP/Javascript - DerBerliner2015 - 06-03-2017 Wordpress? RE: Help with PHP/Javascript - Lunacy - 06-03-2017 (06-03-2017, 07:28 PM)DerBerliner2015 Wrote: Wordpress? Yes RE: Help with PHP/Javascript - Lunacy - 06-03-2017 Solved ! Thanks |