You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

m.getOverlay is not defined Created Sep 18, 2009

This thread is solved

Views: 2885     Replies: 7     Last reply Nov 12, 2009  
You must login first before you can use this feature

sgraber

Posts: 6

Registered:
Sep 18, 2009

m.getOverlay is not defined

Posted: Sep 18, 2009

I'm getting the following error in Firebug's console:

m.getOverlay is not defined

I'm using the minified version of jquery.tools.min.js version 1.1.1. I've tried both using the CDN version and a locally saved version and I've received the same effect.

My script is as follows:

$("#region-content div a.popup").overlay({ 
    target: '#gallery', 
    expose: '#f1f1f1'
  }).gallery({speed:800});

and my HTML looks like so:

<div id="#region-content">
    <div>
        <a class="popup" href="foo/bar.jpg">
            <img src="foo/bar.jpg" />
        </a>
    </div>
</div>

This is consistently throwing an error for me and I'm uncertain what's going on. Based on what I've read in the docs, this should be working.

You can see a working example of the problem I'm seeing onhttp://dev.advancedaquarist.com/2009/4/fish

Any help would be appreciated. Thanks,

Shane

Tero
Author of jQuery Tools and this website + JavaScript developer of Flowplayer.

Posts: 1867

Registered:
Nov 16, 2007

» m.getOverlay is not defined

Posted: Sep 18, 2009

Reply to: m.getOverlay is not defined, from sgraber
You are using #- character on your id. should be


<div id="region-content">
 ...
</div>

sgraber

Posts: 6

Registered:
Sep 18, 2009

» » m.getOverlay is not defined

Posted: Sep 18, 2009

Reply to: » m.getOverlay is not defined, from tipiirai
Typo on my part in posting here. :P

Tero
Author of jQuery Tools and this website + JavaScript developer of Flowplayer.

Posts: 1867

Registered:
Nov 16, 2007

» » » m.getOverlay is not defined

Posted: Sep 19, 2009

Reply to: » » m.getOverlay is not defined, from sgraber
so you mean that you got things solved? At least I saw your gallery working on my browser.

sgraber

Posts: 6

Registered:
Sep 18, 2009

» » » » m.getOverlay is not defined

Posted: Sep 19, 2009

Reply to: » » » m.getOverlay is not defined, from tipiirai
Yep, I got it solved. Apparently if I call:

$("#content div a.popup").overlay({  
    target: '#gallery',  
    expose: '#f1f1f1' 
  }).gallery({speed:800});

on any page that doesn't contain the above target, it will throw the 'm.getOverlay is not defined' error. For some reason chaining .gallery() to the end of the .overlay() method throws an error if there aren't any matches in the DOM. The way I got around it was by testing for its existence prior to calling the method:

var imgGallery = $("#content div a.popup").size();

if (imgGallery) {
    // we have to do an if/then on this otherwise when .gallery() gets called on a 
    // page that doesn't have an image gallery the script errors out and stops 
    // everthing from working
    $("#content div a.popup").overlay({ 
        target: '#gallery', 
        expose: '#4c4c4c'
    }).gallery({speed:800});
};

Shane

Tero
Author of jQuery Tools and this website + JavaScript developer of Flowplayer.

Posts: 1867

Registered:
Nov 16, 2007

» » » » » m.getOverlay is not defined

Posted: Sep 19, 2009

Reply to: » » » » m.getOverlay is not defined, from sgraber
OK. Great. I guess I need to make better error messages. Added on my TODO list.

eib

Posts: 1

Registered:
Sep 9, 2009

same problem, another solution

Posted: Sep 25, 2009

Reply to: m.getOverlay is not defined, from sgraber
Thanks for the forum post - this really helped me solve the same problem on a web site I am currently developing.

I solved the problem using the "each()" function. I would like to have multiple galleries on a page, so instead of using a gallery ID I use a gallery CLASS.


$(".gallery").each(function() {
  $("a",this).overlay({  
    target: '#gallery',  
    expose: '#4c4c4c' 
  }).gallery({speed:800});
});

Now I have my problem solved, and have multiple galleries on the same page.

Excellent!

michael.ferstle

Posts: 3

Registered:
Nov 5, 2009

I am trying your use of the each function...

Posted: Nov 12, 2009

Reply to: same problem, another solution, from eib
...but I cannot get the galleries to remain separate. Instead of several galleries with 3, or 7 photos, I have one continuous gallery with 36 images.

Am I misunderstanding what your use of the each() function is for?