Help! Javascript/jQuery question.
Permalink
Hi, I really need some help here. I've installed the O'Slider jQuery image slider (really nice) and I'm having problems with the pages it's installed on. On every page that the below script is installed on, my Edit pop up menu is solid black with black text and it disappears after a second or so.
The slider is working so I'm assuming that the scripts themselves are fine but them I know little about this. I'm also unsure how to debug this using firebug. Do the below script show anything particularly unusual?
Thanks to anyone who can help.
The slider is working so I'm assuming that the scripts themselves are fine but them I know little about this. I'm also unsure how to debug this using firebug. Do the below script show anything particularly unusual?
Thanks to anyone who can help.
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <? Loader::element('header_required'); ?> <script type="text/javascript" src="//use.typekit.net/llh0hdi.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="stylesheet" media="all" href="/adb/themes/adb/css/reset.css" /> <link rel="stylesheet" media="all" href="/adb/themes/adb/css/style.css" /> <link rel="stylesheet" media="all" href="/adb/themes/adb/js/oslider/o.slider.css" /> <link rel="stylesheet" media="all" href="/adb/themes/adb/css/examples.css" /> <script type="text/javascript" src="/adb/themes/adb/js/oslider/jquery.o.slider-1.0.js"></script>
Viewing 15 lines of 18 lines. View entire code block.
Anyone? I would be very grateful if someone could point me in the right direction here.
You should check the page and scripts loaded in the developer console in 3 states:
- No one logged in
- Logged in, but viewing page
- Logged in and editing page
The scripts that C5 loads varies with each of the above (and with other addons on the page). You need to confirm you have what you need, and that you are not conflicting with anything else.
http://www.concrete5.org/documentation/how-tos/editors/getting-help...
You could also have an error in your php that only shows in edit mode (less likely, but worth double checking).
- No one logged in
- Logged in, but viewing page
- Logged in and editing page
The scripts that C5 loads varies with each of the above (and with other addons on the page). You need to confirm you have what you need, and that you are not conflicting with anything else.
http://www.concrete5.org/documentation/how-tos/editors/getting-help...
You could also have an error in your php that only shows in edit mode (less likely, but worth double checking).
Hi John, thanks for your reply but this is a bit out of my depth I'm afraid. Would a very brief outline of the tools and rough description of what I should be doing be possible, just so that I have a bit of an idea of what kind of thing I should be doing?
I looked at firebug and the console part on that is confusing (I'm a designer not a coder!).
Thanks again for your help.
I looked at firebug and the console part on that is confusing (I'm a designer not a coder!).
Thanks again for your help.
Jordanlev raises a very good point, something that can easily happen adding javascript.
The level of explanation you are asking for, best to read something like Remo's book. It doesn't answer this specifically and barely touches jQuery, but provides the grounding in c5 needed to understand a lot about developing.
The level of explanation you are asking for, best to read something like Remo's book. It doesn't answer this specifically and barely touches jQuery, but provides the grounding in c5 needed to understand a lot about developing.
My guess is that your slider code is picking up the edit popup menu and trying to slide it. Might want to use an id instead of class for the slider container. Or disable the sliding effect while in edit mode by doing something like this:
<?php if ($c->isEditMode()): ?> Slider disabled in edit mode <?php else: ?> ...all your slider code goes here... <?php endif; ?>
Thanks Jordan. When I place the div containing the images for the slider into the slider div it is an id.
Just out of interest, when you yourself add an image slider that's not a c5 add-on, is there anything that you do other than adding the header scripts to the pages that the slider will appear on, then making the div on your template editable in the usual fashion, then Add Block>HTML and paste in the slider div info and links?
I only ask as I've done two non add-on sliders and both display every slide vertically one on top of the other, right down the page when in edit mode. Although they seem to work fine when you publish your page, it feels as if you are doing something wrong to have it looking this messy.
Thanks for the info anyway.
JP.
Just out of interest, when you yourself add an image slider that's not a c5 add-on, is there anything that you do other than adding the header scripts to the pages that the slider will appear on, then making the div on your template editable in the usual fashion, then Add Block>HTML and paste in the slider div info and links?
I only ask as I've done two non add-on sliders and both display every slide vertically one on top of the other, right down the page when in edit mode. Although they seem to work fine when you publish your page, it feels as if you are doing something wrong to have it looking this messy.
Thanks for the info anyway.
JP.
I don't hard-code my sliders into my themes, instead I build a block for it. See:
http://c5blog.jordanlev.com/blog/2011/12/build-a-slideshow-block/...
http://c5blog.jordanlev.com/blog/2011/12/build-a-slideshow-block/...
Thanks Jordan, I'll take a (very) deep breath and give your tutorial a whirl as soon as I can. Thanks also to johnthefish for your suggestions. Even though concrete5 is a joy to use, it's still complex for the non-programmer types like me as soon as things like javascript become involved. I could probably save myself a lot of trouble by sitting down for a week or so and studying the basics of php and javascript.
Thanks again for your suggestions.
JP.
Thanks again for your suggestions.
JP.