Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. $(document).ready(function(){
  2. $(".addCart").click(function(){
  3. $.post(".addCart.val()",function(data){
  4. $("#test").html(data).show();
  5. });
  6. });
  7. });
  8.  
  9. <div id="test" style="background-color: grey"></div>
  10.  
  11. <?php while ($row = mysqli_fetch_array($products)):?>
  12. <div class="span3">
  13. <div class="product">
  14. <div class="product-img">
  15. <div class="picture">
  16. <img src="images/<?php echo $row['image'] ?>" alt="" width="540" height="374" />
  17. <div class="img-overlay">
  18. <a href="#" class="btn more btn-primary">توضیحات بیشتر</a>
  19. <button value="<?php echo $row['id']?>" class="btn buy btn-danger addCart">اضافه به سبد خرید</button>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="main-titles no-margin">
  24. <h4 class="title"><?php echo $row['price'] ?></h4>
  25. <!--<h5 class="no-margin">محصول ویژه 434</h5>-->
  26. </div>
  27. <p class="desc"><?php echo $row['name']?></p>
  28. <p class="center-align stars">
  29. <span class="icon-star stars-clr"></span>
  30. <span class="icon-star stars-clr"></span>
  31. <span class="icon-star"></span>
  32. <span class="icon-star"></span>
  33. <span class="icon-star"></span>
  34.  
  35. </p>
  36. </div>
  37. </div> <!-- /product -->
  38. <?php endwhile;?>
  39.  
  40. $(".addCart").click(function(event){
  41. var id = event.target.val();
  42. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement