ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Fancybox do not work

February 01, 2011 6:15am

Subscribe [3]
  • #1 / Feb 01, 2011 6:15am

    CmAnD

    3 posts

    I have implemented Fancybox JQuery plugin in my website. It used to work but I have enabled a mod_rewrite by .htacces and Fancybox stoped to work.

    I have the following folder structure

    - images
    - fancybox
    - system
        -application
          -views
            view.php (this is the file where I call the fancybox)

    I have following links in the header:
    type=“text/javascript” src=”<?php echo base_url();?>fancybox/jquery.fancybox-1.3.4.pack.js”
    <link rel=“stylesheet” href=”<?php echo base_url();?>fancybox/jquery.fancybox-1.3.4.css”  media=“screen” type=“text/css” charset=“utf-8”/>


    And I have the following code in my view:

    <table summary="Sertifikates">
    <tr>
    <td><a href="/images/SIQ_Sertificate_ISO9001.jpg%22id=%22siq9001" class="show_sertificates"></a></td>
    <td><a href="/images/IQNet_Sertificate_ISO9001.jpg%22id=%22iq9001" class="show_sertificates"></a></td>
    </tr>
    <tr>
    <td><a href="/images/SIQ_Sertificate_ISO14001.jpg%22id=%22siq14001" class="show_sertificates"></a></td>
    <td><a href="/images/IQNet_Sertificate_ISO14001.jpg%22id=%22iq14001" class="show_sertificates"></a></td>
    </tr>
    </table>
    
    $(document).ready(function() {
    
    
        /* Apply fancybox to multiple items */
        
        $("a.show_sertificates").fancybox({
            'transitionIn'    :    'elastic',
            'transitionOut'    :    'elastic',
            'speedIn'        :    600, 
            'speedOut'        :    200, 
            'overlayShow'    :    false
        });
        
    });


    I have other two JQuery plugins that work well on the same website.

    Any idea about this?

  • #2 / Feb 02, 2011 5:07am

    CmAnD

    3 posts

    I have found the solution.  The problem was in the folder structure.
    .htaccess did not allow to directly access “fancybox” folder that was in my root folder.

    I moved whole “fancybox” folder inside “js” folder, I changed the paths in the header and it works now.

  • #3 / Feb 02, 2011 6:36am

    lsousa

    5 posts

    You can also change htaccess to allow access fancybox folder.

    Something like this

    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|fancybox|robots\.txt)
    RewriteRule ^(.*)$ /index.php/$1 [L]

    Assuming .htaccess is in the root folder.

  • #4 / Feb 02, 2011 6:46am

    CmAnD

    3 posts

    Yes, you are right about that.  I have tried that first. That was my first logical step.
    It should work also, but it didn’t work for me. I don’t know why.

    Thanks for your reply.

  • #5 / Feb 03, 2011 5:51am

    Roy MJ

    92 posts

    Try this one too..

    In the head section of the page concerned put <base href=“http://www.yourdomain.com/” />

    Then u just call up the folder concerned using just foldername/ . I was having problem with lightbox and flash and when i put in the base tag, it worked fine.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases