{"action":"created","issue":{"url":"https://api.github.com/repos/wet-boew/wet-boew/issues/6931","labels_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/6931/labels{/name}","comments_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/6931/comments","events_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/6931/events","html_url":"https://github.com/wet-boew/wet-boew/issues/6931","id":94306642,"number":6931,"title":"Multiple ajaxed-in Lightbox and/or Overlay instances on a page = Extreme lag or page kill","user":{"login":"markbelanger","id":3777175,"avatar_url":"https://avatars.githubusercontent.com/u/3777175?v=3","gravatar_id":"","url":"https://api.github.com/users/markbelanger","html_url":"https://github.com/markbelanger","followers_url":"https://api.github.com/users/markbelanger/followers","following_url":"https://api.github.com/users/markbelanger/following{/other_user}","gists_url":"https://api.github.com/users/markbelanger/gists{/gist_id}","starred_url":"https://api.github.com/users/markbelanger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markbelanger/subscriptions","organizations_url":"https://api.github.com/users/markbelanger/orgs","repos_url":"https://api.github.com/users/markbelanger/repos","events_url":"https://api.github.com/users/markbelanger/events{/privacy}","received_events_url":"https://api.github.com/users/markbelanger/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wet-boew/wet-boew/labels/Plugin:%20Lightbox","name":"Plugin: Lightbox","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":24,"created_at":"2015-07-10T13:24:00Z","updated_at":"2015-08-19T16:40:06Z","closed_at":null,"body":"Is there a way to avoid or to store the call to the i18n and Magnific pop-up JS file when using the Lightbox and/or Overlay plug-ins multiple times on a page? \r\n\r\nI'm using these plug-ins to ajax-in dynamic content on search results records, that contain multiple different Source snippets within each individual record. Search results are limited to 100 records on a page, but each records can contain up to 10 sources (which can equate to a very large amount of Sources on one full page). \r\n\r\nWhen using the Overlay plug-in to ajax-in the source content, the page lags so much that it often times kills the browser altogether. I looked at what FIrebug is trying to process with the JS, and I can see that it's constantly hitting the i18n language file and Magnific Pop-up JS file to process every single time the required functions to make each overlay render what it needs. \r\n\r\nIs there any way to store the required i18n and Magnific script and not have it process its function and sub-routines on every single call? Something that can declare the same parameters to all overlay instances, seeing as that page does not change language per instance of overlay, not does the Magnific pop-up script requirement change for each instance. All the overlays contain the same parameters, just different content.\r\n\r\nI'd really like to take advantage of the Overlay/Lightbox plug-in for a better user experience, but killing the browser or slowing down the load is obviously not an option. \r\n\r\nI want to avoid having a link to a separate page for every Source instance, as the content of each source is minimal, and not worth the extra click or page change. I want the user to quickly have access to their search results and avoid back-and-forth clicking between results and sources."},"comment":{"url":"https://api.github.com/repos/wet-boew/wet-boew/issues/comments/132689250","html_url":"https://github.com/wet-boew/wet-boew/issues/6931#issuecomment-132689250","issue_url":"https://api.github.com/repos/wet-boew/wet-boew/issues/6931","id":132689250,"user":{"login":"markbelanger","id":3777175,"avatar_url":"https://avatars.githubusercontent.com/u/3777175?v=3","gravatar_id":"","url":"https://api.github.com/users/markbelanger","html_url":"https://github.com/markbelanger","followers_url":"https://api.github.com/users/markbelanger/followers","following_url":"https://api.github.com/users/markbelanger/following{/other_user}","gists_url":"https://api.github.com/users/markbelanger/gists{/gist_id}","starred_url":"https://api.github.com/users/markbelanger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markbelanger/subscriptions","organizations_url":"https://api.github.com/users/markbelanger/orgs","repos_url":"https://api.github.com/users/markbelanger/repos","events_url":"https://api.github.com/users/markbelanger/events{/privacy}","received_events_url":"https://api.github.com/users/markbelanger/received_events","type":"User","site_admin":false},"created_at":"2015-08-19T16:40:06Z","updated_at":"2015-08-19T16:40:06Z","body":"There were only (and always) 3 tabs being loaded:\r\n1. Search results\r\n2. Filter by Subject Field\r\n3. Alphabetical list of terms\r\n\r\nSince the lag was happening when many results were returned in the 1st tab (2nd and 3rd tabs are always a maximum of 20 list items), I'm thinking the page calculation to compare to the other tabs (with limited content) of where the tabs break in content, were constantly being calculated when scrolling (which caused a halt when scrolling the approximate equivalent of the height of tabs 2 and 3). The more results there were, the more the page lagged (still calculating??), and the scrolling halt happened in a seemingly calculated manner throughout the results. However, I'm not sure the scrolling was the only lag trigger, as the page would lag right away, even before scrolling.\r\n\r\nFrom what I experienced and from what you're suggesting, it seems the Tabbed Interface plug-in (and possibly others??) are continuously calculating during the time the user spends on a given page. Which in turn, could cause significant lagging if there is a large amount of content, mixed in with using plug-in that rely on calculating the given interface and screen."}}