-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image slideshow not working on firefox devices #46
Comments
Maybe it is possible to do horizontal slide with the new commit you've made ? |
It seems there's a problem with vertical centering ( I will check it out. Thanks for reporting it! |
Hope that it don't come from the changes I have made (only on html/css) and that I don't make you lose your time... Thanks ! |
The problem can be seen also with the $(document).ready(function() {
$.fn.fullpage({
'verticalCentered': true
});
}); |
Check out the last commit. Download the last version and let me know if it is fixed for you in Firefox or IE 9. |
By the way, it would be nice if you want to add your site to the section who is using fullPage.js on the documentation. :) |
Also, I would recommend you to load the images on the fly in order to avoid such a big loading of the site. Simply use the #slide1 {
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
height: 100%;
}
#slide1.active{
background: url(../img/portraits/01.jpg) no-repeat center;
} Or if you want to deal with callbacks you could use the callbacks $.fn.fullpage({
onLeave: function(index, nextIndex, direction){
//after leaving section 1
if(index == '1' && direction =='down'){
//Going to section 2!
$('#section2').find('.slide').addClass('loadImage');
}
}
}); If you want to make it more generic instead of having to create a condition for each slide or section, you could use this instead: $.fn.fullpage({
onLeave: function(index, nextIndex, direction){
var leavingSection = $(this);
var slide = leavingSection.find('.slide.active');
//is there any slide in the section ?
if(typeof slide !== 'undefined'){
destination = slide;
}else{
destination = leavingSection;
}
destination.addClass('loadImage');
}
}); And in your CSS had something like: #slide1 {
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
height: 100%;
}
#slide1.loadImage{
background: url(../img/portraits/01.jpg) no-repeat center;
} This way the images won't be load when the user access the site but when he is about to arrive to one section. Just an idea :) |
It seems to be ok ! Thanks a lot !! And thanks for this recommendation I will try it as soon as possible. For the section "who is using", no problem, just let me finish the work and put it on it's future url (i will communicate it to you) :) |
Ok. Thanks :) |
Hi, Now that I've finished the choice and work on different pictures, I've got a few last questions before (finally!!!) to put my website online : http://www.gabrodrigues.com/teste
|
Hi @snab-gab, first of all, download the last version of the plugin (the .js and the .css file). The last version is the 1.2.85 and you still in the 1.1 which has been improved quite a lot. Then, let me know if you still having that problem. About your second point, this is beyond the plugin topic. You would need to use media queries or use the viewport meta tag in some specific way. You could also detect whether is a mobile phone or not and load another CSS style sheet. Google about it. I can not advice you on that. |
Hi, Thanks for your answer. I donwloaded the last version and it doesn't change anything for the resizing problem. Here is a screenshot of what it does. For the second point, i was wondering if this part of code could change smtg ? :
By the way, the website is online, If you're still ok to add it to the website using fullsize.js list, here is a link : www.carlphot.com Thanks for your time answering my questions :) |
I don't have an android device and I can not test it by my own. I will take a look anyway and let you know. Also, you are importing the minified version and the full one. Just import one. You are slowing down the loading of your site and adding unnecessary code. I would also recommend you to load the first slide image of your sections on load, so the user will always see the first image and the transition correctly. Then, you can still load the rest of the slides dynamically as you are doing. About the second point. You can call the resizeMe method on load using the Notice that you have to add the ´resizeMe´ function outside the plugin to be able to call it on the callback. |
Ok, I will try this. Thanks a lot ! |
This was exactly what I was looking for thanks ! |
Follow-up comment here for somebody who just launched the first |
@lkraav Also interested in lazy loading 20+ slides of a section. Are you thinking to always have 2 slides loaded starting with the initial slide and then as the user progresses through the slide show it keeps always loading the next 2 slides? I will see if I can come up with a fiddle for such a function. Feel free to add your thoughts about this also please if you find time, thank you. |
This is a nice trick but is there any way to keep the images visibles when leaving the section? Cause right now, as soon as I leave the section the image disappear immediately and it's quite weird :) |
Then you'll have to load them before leaving the section, which is not easy as you never know to which section is the user going to go next. (if provided a menu or nav) If bandwidth is not a problem for you, I would encourage you to load them all after load, so they won't influence the loading time of the page. You can do something like this: $(window).load(onLoad);
//loading all images from all sections
function onLoad(){
$('.fp-section').addClass('loadImage');
} And use the #slide1 {
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
height: 100%;
}
#slide1.loadImage{
background: url(../img/portraits/01.jpg) no-repeat center;
} |
Thanks Alvaro! I don't know why the javascript isn't working in my case, if I inspect the page it doesn't add that "loadImage" class. |
To answer to your comment (sorry, I'm just discovering github universe).
Here is a link of what I'm trying to do : http://www.gabrodrigues.com/teste
I got troubles on every Firefox devices (only). Or there no image, or the image scale is not good.
The text was updated successfully, but these errors were encountered: