Guest User

Untitled

a guest
Feb 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <div id="v1"><div id="add_fav_guestv1"> + </div> video 1</div>
  2. <div id="v2"> <div id="add_fav_guestv2"> + </div>video 2</div>
  3. <div id="v3"> <div id="add_fav_guestv3"> + </div>video 3</div>
  4. <div id="fv"></div>
  5. <script>
  6. /*Adicionar à lista*/
  7. $(document).ready(function() {
  8. var idFav= "<?= $fetch['id_video'] ?>";
  9. var oldValue = $.cookie("have_fav_list");
  10.  
  11. $("#add_fav_guest"+idFav).click(function(){
  12.  
  13. if($.cookie("have_fav_list")){
  14. $.cookie("have_fav_list", idFav + "_" + oldValue);
  15. } else {
  16. $.cookie("have_fav_list", idFav);
  17. }
  18.  
  19. });
  20. });
  21. /* Pegar o conteudo do cookie e inseri-lo na dv #fv sem refresh*/
  22. $(document).ready(function() {
  23. $("#fv").append( _gaq.push([$.cookie('have_fav_list')]));
  24. });
  25. </script>
Add Comment
Please, Sign In to add comment