Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8663233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:56:05+00:00 2026-06-12T16:56:05+00:00

I am using jQuery Wookmark in my website …everything works fine…but when i refresh

  • 0

I am using jQuery Wookmark in my website …everything works fine…but when i refresh the page the page layout breaks….why??

Correct Layout

enter image description here

Wrong layout after page refresh using F5

enter image description here

Why does this happen?? After page reload this happens…any idea why??

JS

 <script type="text/javascript" src="js/jquery.wookmark.js"></script>

    <!-- Once the page is loaded, initalize the plug-in. -->

    <script type="text/javascript">
        var handler = null;
        var pageIndex = 1;
        var pageCount;
        var isLoading = false;
        var apiURL = 'Haggler.asmx/GetCategories'

        // Prepare layout options.
        var options = {
            autoResize: true, // This will auto-update the layout when the browser window is resized.
            container: $('#tiles'), // Optional, used for some extra CSS styling
            offset: 17, // Optional, the distance between grid items
            itemWidth: 190 // Optional, the width of a grid item
        };

        /**
        * When scrolled all the way to the bottom, add more tiles.
        */
        function onScroll(event) {
            // Only check when we're not still waiting for data.
            if (!isLoading) {
                // Check if we're within 100 pixels of the bottom edge of the broser window.
                var closeToBottom = ($(window).scrollTop() + $(window).height() > $(document).height() - 100);
                if (closeToBottom) {
                    loadData();
                }
            }
        };

        /**
        * Refreshes the layout.
        */
        function applyLayout() {
            // Clear our previous layout handler.
            if (handler) handler.wookmarkClear();

            // Create a new layout handler.
            handler = $('#tiles li');
            handler.wookmark(options);
        };

        /*
        * Loads data from the API.
        */
        function loadData() {
            isLoading = true;

            if (pageIndex == 1 || pageIndex <= pageCount) {
                $('#loaderCircle').show();

                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: apiURL,
                    dataType: 'json',
                    data: '{pageIndex:' + pageIndex + '}', // Page parameter to make sure we load new data
                    success: function(data) {
                        //alert("SSS");
                        isLoading = false;
                        $('#loaderCircle').hide();

                        // Increment page index for future calls.
                        pageIndex++;

                        // Create HTML for the images.
                        var html = '';
                        pageCount = data.d[1].PageCount;
                        var i = 0, length = data.d.length, image;
                        //alert(JSON.stringify(data.d));
                        //                      image = data.d[1];
                        //                      alert(image.height);
                        for (; i < length; i++) {

                            image = data.d[i];
                            //alert(image.height);
                            html += '<li class="polaroid"><div class="optionbg"></div><div class="optionback"><span>' + data.d[i].NodeName + '</span></div><div class="options"><span class="favs">14</span><span class="fav">like it!</span></div><a href="http://www.google.co.in"><img src="' + image.image + '" width="180" height="' + Math.round(image.height / image.width * 180) + '"></a></li>';

                        }
                        // Add image HTML to the page.
                        $('#tiles').append(html);

                        // Apply layout.
                        applyLayout();
                    },
                    error: function(result) {
                        //alert(JSON.stringify(result));
                    }
                });

            }


        };

        /**
        * Receives data from the API, creates HTML for images and updates the layout
        */


        $(document).ready(new function() {
            // Capture scroll event.
            $(document).bind('scroll', onScroll);

            // Load first data from the API.
            loadData();
        });
    </script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:56:07+00:00Added an answer on June 12, 2026 at 4:56 pm

    wrap you code inside

    $(document).ready(function () {
    //your code
    }
    

    It calls your code every time your page reloads. Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im using the Wookmark jQuery grid layout for my website. https://github.com/GBKS/Wookmark-jQuery I need the
Using jquery 1.7.1, I'm using json to populate the dropdown. The code works just
Using Jquery AJAX to get a value from a PHP script. This line works
Using JQuery: Sometimes, I can do variable.val() and it works. Sometimes, I'm required to
Using jQuery I'd like to add additional top-margin to a div 'foo', but only
Using jQuery validation plugin but it has no CSV validation. I have made an
Using jQuery, how can I: Have all checkboxes on a page turned checked on
Using JQuery how would I make the page dim / fade and display a
Using jQuery timepickr: http://archive.plugins.jquery.com/project/jquery-timepickr Having included these files: jquery-1.7.1.min.js jquery-ui-1.8.21.custom.min.js ui.timepickr.js And getting this
Using Jquery TableSorter, I am creating a custom parser to sort elapsed time <td>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.