Results 1 to 6 of 6

Thread: Closing Facebox

  1. #1
    Join Date
    Oct 2011
    Location
    London
    Posts
    41
    Thanks
    19
    Thanked 1 Time in 1 Post

    Default Closing Facebox

    hi all i am playing with Facebox and i want to put a close on it, it said to and i quote
    Code:
    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
    Code:
    <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 )

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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:
    Code:
    <input type="button" value="Close" onclick="jQuery(document).trigger('close.facebox');">
    Does that work?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Oct 2011
    Location
    London
    Posts
    41
    Thanks
    19
    Thanked 1 Time in 1 Post

    Default

    Hi thanks for quick reply but i get this error
    Code:
    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');

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.)
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Oct 2011
    Location
    London
    Posts
    41
    Thanks
    19
    Thanked 1 Time in 1 Post

    Default

    ok i am using this http://www.dynamicdrive.com/dynamici...ebox/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:
    Code:
    jQuery(document).trigger('close.facebox')
    i just dont know how to use it

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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).
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •