KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have developed a widget for Wordpress to show portfolio, the user can choose if he wants pagination, filter categories, the number of post per page...and so on, it works all perfectly with a php pagination system i have made. I am trying to implement an ajax jquery to this pagination in widget to make it reload without reloading the whole page. I have this code: jQuery('.paginate a').live('click', function(e){ e.preventDefault(); var link = jQuery(this).attr('href'); jQuery('.widget_gantry_portfolio').html('<div class="loading"></div>'); jQuery('.widget_gantry_portfolio').load(link+' .widget_gantry_portfolio .portfolio_class'); The pagination works perfectly in php, when I implement this code the pagination works but when clicked the widget losses all the user preferences(show filter, show pagination..etc), the divs also loose their calculated % width and height that was firstly present in css(seen in firebug ): element.style{width and height} I have been several days around this and have prove instead of live, on and delegate , and so on, but none of them work, this ajax pagination is working also perfectly in posts pagination on my site but the widget does´nt reload Dom elements? The most important thing for me are: -Each of the elements missing width and height, that was in DOM css, firstly this width is calculated with a functions.php enqued script that goes like this for example when it has 4 columns: var mysizes = function() { theWidth4 = jQuery(".mosaic-block4c img").css('width'); jQuery(".mosaic-block4c").css('width', theWidth4); theHeight4 = jQuery(".mosaic-block4c img").css('height'); jQuery(".mosaic-block4c").css('height', theHeight4); } I call the mysizes(); function from the widget php with a tag -The filter of categories missing i think because, when
Tags (comma-separated)
Save Edits
Cancel