View Full Version : Closing Facebox
TwitterRooms
10-21-2011, 09:33 PM
hi all i am playing with Facebox and i want to put a close on it, it said to and i quote
jQuery(document).trigger(\'close.facebox\');
but i dont know what this means can any one put in the correct syntax please. i have tryed this
<input type="button" value="Close" onclick="jQuery(document).trigger(\'close.facebox\');">
but dont work (sorry im new at all this so go easy on me :) )
djr33
10-21-2011, 09:49 PM
The backslashes are used to escape (deactivate) the single quotes when they are inside single quotes:
For example, 'can\'t'
But you don't need them there I don't think:
<input type="button" value="Close" onclick="jQuery(document).trigger('close.facebox');">
Does that work?
TwitterRooms
10-21-2011, 09:58 PM
Hi thanks for quick reply but i get this error
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in XXXX.PHP
also is this the correct way to use jQuery(document).trigger('close.facebox');
djr33
10-21-2011, 10:07 PM
If this is embedded in PHP then you'll need to show us more of the script. (And that might be why those slashes were there-- you might need them.)
TwitterRooms
10-22-2011, 08:08 AM
ok i am using this http://www.dynamicdrive.com/dynamicindex4/facebox/index.htm
and the last line said
You can directly close the Facebox container once it's open via scripting, instead of the default path of the user clicking on the "close" button. The method to call is:
jQuery(document).trigger('close.facebox')
i just dont know how to use it
djr33
10-22-2011, 04:57 PM
If you provide a link to your page someone may be able to find the problem. If you're using PHP to generate it (based on the error, it looks like you are) then there are two steps: 1. figure out what HTML output you need; 2. figure out how to make PHP generate that output. For the PHP, those slashes may be needed (but they won't appear in the final HTML).
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.