Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 23rd, 2012  |  syntax: None  |  size: 0.57 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var $p1 = $("#Pagination");
  2.  
  3.  
  4. $p1.click(function() {
  5.   //remove any other extra paginations (applicable only on second click)
  6.   $(".DABEAR_IS_GREAT").remove();
  7.  
  8.   var $p2 = $p1.clone(true).addClass("DABEAR_IS_GREAT");
  9.   $p2.find("*").click( function(){
  10.           //re-add "bubbling" of event
  11.           $(this).closest(".pagination").click();
  12.    });
  13.  
  14.   $p2.appendTo(document.body)
  15.  
  16. })
  17. .click();
  18.  
  19. //replace the second pagination each time the first pagination is updated
  20. $(".DABEAR_IS_GREAT").live("click", function(){
  21.    $(this).replaceWith($p1.clone(true));
  22. })