C5 Image Slide Show only shows when in Edit Mode
Permalink 1 user found helpfulAnother thought, could there be an error in the non-edit mode part of your own javascript?
Without "$(document).ready", a script could be executed as soon as the browser sees it in the document.
I cant tell you why "$(document).ready(function()" was not running, though a likely reason is a faulty loading of jQuery (perhaps a double loading). So in your first stage of removing it and leaving your script in the head, the script may have been failing because it was running too soon. Your second stage, moving the script to the document body, has delayed the scripts execution a little bit until everything is in place.
BUT (and its a BIG BIG BUT), you cannot depend on this. Slightly different timings of downloads from the server, or a different browser or browser version, or adding another block that uses jquery or javascript to the page, or moving from a development server to an online server, all change the background in which your script is executing. It may still work, or it may not.
You really need to look at the page loading with the developer console or firebug open and find out why "$(document).ready was not running. A possible candidate is that you were loading jQuery or another script more than once and so the second time resulted in a double declaration error, thus preventing further javascript from running.
Failing that, you could use a regular javascript window.onload or document.onload event handler to start your script.
(but you would still be fixing the symptom rather than the root cause)
I am a novice. I looked up this problem because my blog page is only showing when I am in edit mode.
I cleared my cache and that didn't enable my blog page to appear in normal mode.
So then it seems the next step is to compare the source code in edit and regular mode...but I can't see the source code in regular mode, since i can't see the page in regular mode.
Also, I want to know please, what words of code am I specifically looking for?
I'd sure appreciate your response on this...I am stymied. Thanks ~~
and I found this:
$(document).ready(function(){
imgLoader = new Image();// preload image
imgLoader.src = jQuery.fn.dialog.loaderImage;
But I couldn't try deleting it until I said I wanted to edit it, and then a whole different set of code was visible, and I could no longer find what I saw before (above) anywhere.
Help will be appreciated.
I did go in to see if there were access restrictions to the blog page, did not find any, and am not even familiar with how to create such a thing.
Is the fact that this happened mean that Concrete 5 is unstable?
Hope this helps people with the same issue.
Rei
Waroly
http://www.concrete5.org/community/forums/usage/slideshows-disappea...
In C5, go to the dashboard, sitewide settings, bottom right (ish) panel and clear the cache (and maybe turn it off while you are developing).
You may also have a page sticking in the browser cache or on a proxy server; that all depends on your browser settings and how your ISP provides your internet connection (though current browsers are pretty good at knowing when to update, a few years back they could be very stubborn).
Another possibility is that javascript for the gallery is only being loaded in edit mode. An easy way to check is to view source in both edit mode and normal display and see if the gallery script is running.
A final possibility is that another block on your site is also loading the same script, perhaps under a different name. Using firebug or other developer options, look at the javascript console for an error message along the lines of 'function xx is already defined'. The popup login is a component that can introduce this issue only when you view a page. In this case you will need to disable the loading of the duplicated script.