got it working as above but when i add it into my website it doesn’t work so i think i have an issue with conflicting scripts so going to have to try and work out which one is causing the issues.
Thanks for you help as i at least know that works and can try and find whats stopping it.
So i’ve done a bit of checking and making sure it wasn’t due to a different version of jquery or something. I’ve got it working using the bare min on a plain page without the rest of my template code
So this is working using jquery 1.4.2 (http://mcsuk.org/working/nyromodal/index_v2.php)
But when i put it into my template it doesn’t work! http://mcsuk.org/working/nyromodal/index_v1.php
the console is reporting ‘TypeError: $(…).nyroModal is not a function’ but i don’t know what that means? is it conflicting with something else? any ideas what i need to amend?
The reason is that the above file also contains a version of jQuery and including it after nyroModal is overwriting any event-listeners etc. that nyroModal might have registered.
Awesome thanks so much. It wasn’t playing ball for a while and then i swapped the order to what you have above and its fine. I need to check one other thing works as it isn’t on the example page but everything else seems to be working fine (side bar accordian, dropdown menu, slider at the bottom)
For the future is there something i should look for to find which bit is causing the problem when i get issues like this? I’m pretty new to actually coding javascript i normally hope it works when i put it all together
Well, when I’m trouble shooting something like this, I make sure I can reproduce the problem, then strip away little bits of the code, checking periodically to see if the problem persists. 99 times out of 100, you can find the error doing it this way.
I had got as far as stripping out all of the content and styles on your page, then I removed the file I mentioned and things suddenly worked.