I am using default Light box and Jquery of Elgg 1.8. I want to implement login and register lightboxs on home page. I am able to archive it perfectly. Now I want to change size of light box, which I know can be archived by this:
$('.elgg-lightbox').fancybox({
'width': '80%',
'height': '80%',
'type': 'ajax',
'ajax': {
dataFilter: function(data) {
return $(data).find('.elgg-body form');
}
}
});
Now problem is, I am getting error : "$('.elgg-lightbox').fancybox is not a function".
So I tried to find if fancybox is loading correctly, using this :
if(typeof $.fancybox == 'function') {
console.log("fancy box loaded");
} else {
console.log("fancy box not loaded");
}
On page load, It echoed "fancy box loaded" but when I am clicking on login button I am getting "fancy box not loaded". and then getting above error : "$('.elgg-lightbox').fancybox is not a function".
So I am not able to understand why it is unloading it onclick. Any guidance will be helpful.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- apaleja@apaleja
apaleja - 0 likes
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
You must log in to post replies.Try to replace .elgg-lightbox with another class, e.g. .my-lightbox
And my question is where/how you call it?
Thanks @RvR,
That worked well. Now it is not showing any error But it is note changing size of light box. Am I still missing something ?
I have custom index page with login / register buttons. So on button click it shows respective box for login / register.
Try:
Or use CSS only w/o JS