Ask Question Forum:
Model Library:2025-02-08 Updated:A.I. model is online for auto reply question page
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by kk89
at 2024-08-09 13:24:33
Point:500 Replies:6 POST_ID:828730USER_ID:11631
Topic:
Miscellaneous Web Development;JavaScript;PHP Scripting Language
Hi,
I have a header that calls in fancybox lightbox on galleries, and on certain pages a I have a plugin (working with wordpress) that calls for next gen light box. Right now on a certain type of gallery pages when you click on the image both lightboxes appear. Is there a way to add code to my plugin php to disable just the fancy box lightbox JavaScript?
I know the easy thing would be to change the plugin to use fancy box but that would call for an overhaul of the plugin which I would like to avoid.
Hopefully that makes sense, please let me know if you need more information.
I have a header that calls in fancybox lightbox on galleries, and on certain pages a I have a plugin (working with wordpress) that calls for next gen light box. Right now on a certain type of gallery pages when you click on the image both lightboxes appear. Is there a way to add code to my plugin php to disable just the fancy box lightbox JavaScript?
I know the easy thing would be to change the plugin to use fancy box but that would call for an overhaul of the plugin which I would like to avoid.
Hopefully that makes sense, please let me know if you need more information.
Accepted Solution
Expert: julianH replied at 2024-08-12 12:33:22
500 points EXCELLENT
On the gallery1 page you have this
This is going to bind the lightBox plugin to all <a> elements with the popup class
Earlier in the code you have
var fb_IMG_select = 'a[href*=".jpg"]:not(.nofancybox), area[href*=".jpg"]:not(.nofancybox), a[href*=".jpeg"]:not(.nofancybox), area[href*=".jpeg"]:not(.nofancybox), a[href*=".png"]:not(.nofancybox), area[href*=".png"]:not(.nofancybox)'; jQuery(fb_IMG_select).addClass('fancybox'); 1:2:
Which is binding fancybox to the same gallery.
Writing script to disable one of the pluggins is a really bad way of handling this - you are adding plugins to your site and then disabling them with script - is sort of like trying to hold yourself back in a race...
What you need to do is work out how each plugin is setup to bind to a particular gallery.
Name your gallery (galleries) differently
Configure your plugins to bind to the right elements.
If your plugins don't allow you to do that then they are not any good.
Writing a gallery with lightbox or fancy box attached is pretty straight forward - 9 times out of 10 plugins are just bloat-ware with a 1000 extra functions you might need but never use.
If you need more asstence from this forum you will have to provide a bit more info on the plugins you are using.
Author: kk89 replied at 2024-08-12 11:18:02
Thanks to everyone who has responded and I hope everyone had a good weekend. :)
To show an example here is a page with the fancy box (please ignore the blurry photos I sized them incorrectly) : http://koracart.marathonwp.com/lifestyle-photos/
and heres a link to the plugin I used for that: http://wordpress.org/plugins/fancybox-for-wordpress/
Here is a link of both galleries activated: http://koracart.marathonwp.com/photogallery/gallery1/
The plugin that was built is using lighbox, so worse case scenario I can always just make lightbox the default plugin for all galleries I just think fancybox is more aesthetically pleasing. I have the fancy box set up so it displays only on wordpress galleries.
Ideally I would like to avoid editing the fancy box plugin, so if there is an update I don't have to worry about it overwriting. Also I would like to avoid editing the header of the theme so the "cart plugin" could be used with any other theme without additional modifications.
I thought a code for disabling a javascript would work best because either gallery auto generates the code for lightbox and fancybox. But then again I don't know if you can do such a thing.
To show an example here is a page with the fancy box (please ignore the blurry photos I sized them incorrectly) : http://koracart.marathonwp.com/lifestyle-photos/
and heres a link to the plugin I used for that: http://wordpress.org/plugins/fancybox-for-wordpress/
Here is a link of both galleries activated: http://koracart.marathonwp.com/photogallery/gallery1/
The plugin that was built is using lighbox, so worse case scenario I can always just make lightbox the default plugin for all galleries I just think fancybox is more aesthetically pleasing. I have the fancy box set up so it displays only on wordpress galleries.
Ideally I would like to avoid editing the fancy box plugin, so if there is an update I don't have to worry about it overwriting. Also I would like to avoid editing the header of the theme so the "cart plugin" could be used with any other theme without additional modifications.
I thought a code for disabling a javascript would work best because either gallery auto generates the code for lightbox and fancybox. But then again I don't know if you can do such a thing.
Expert: duncanb7 replied at 2024-08-10 21:35:38
http://www.experts-exchange.com/Web_Development/Blogs/WordPress/Q_28209480.html
I also have similar issue from the attached link,
I think you can change the CSS file or plugin Setting that provided by the plugin author for faster way, otherwise, you need to spent a lot time and code to
fix your problem
If you provide capture screenshot on your issue before and afert, name of plugin and its code, that will speed up to solve your issue , sometimes also solve my issue
Please advise for sharing
Duncan
I also have similar issue from the attached link,
I think you can change the CSS file or plugin Setting that provided by the plugin author for faster way, otherwise, you need to spent a lot time and code to
fix your problem
If you provide capture screenshot on your issue before and afert, name of plugin and its code, that will speed up to solve your issue , sometimes also solve my issue
Please advise for sharing
Duncan
Expert: julianH replied at 2024-08-10 02:37:11
Usually fancy box and lightbox are attached to certain classes or id's of elements.
What you need to do is change the classes on the two different items (or whatever method is being used for fb and lb to bind to the elements in question) so that they are uniquely identifiable.
Then setup lightbox and fancybox to bind to the relevant elements using the unique identifier (usually a class)
For example
What you need to do is change the classes on the two different items (or whatever method is being used for fb and lb to bind to the elements in question) so that they are uniquely identifiable.
Then setup lightbox and fancybox to bind to the relevant elements using the unique identifier (usually a class)
For example
<div id="gallery" class="lightbox"> ...</div>$('.lightbox').lightBox();<div id="gallery2" class="fancybox">...</div>$('.fancybox').fancyBox({ ... options }); 1:2:3:4:5:6:7:8:9:10:
Without more information on your site can't be more specific. So best to post a link so we can see what is going on.
Expert: COBOLdinosaur replied at 2024-08-09 15:45:22
Post a link or the code please.
Cd&
Cd&
Expert: Ray Paseur replied at 2024-08-09 13:29:18
Are you using jQuery? If so, you might want to add this to the jQuery Zone. Use the Request Attention button if you want to do that.