-
Notifications
You must be signed in to change notification settings - Fork 7
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
Caption overlapping image #1
Comments
Thank you! I'll check this soon ... |
Just tested it in "UC Browser" on Android 4.4 - same problems as you described. But works fine in mobile Chrome/Firefox/Opera |
Sorry I wasn't more specific - on Android 4.2.2 the problem shows in all tested browsers - Chrome, Firefox, and Opera. (and the Android browser) I have just updated all the browsers to the latest version, and the problem persists. (I don't have the UC browser) Thanks for looking into this! |
Can you set imgCSS: 1000 at your test page? This setting doesen't exist on your test page at the moment. |
I see now that zIndex is declared twice - to 102 in line 499, and to 1000 in line 503. |
There is some kind of bug or feature with z-index and CSS3 translate3d for swiping. I'll find some info about this later. At the moment you can use following options: $('a[href$=".jpg"]').abigimage({
boxCSS: {
zIndex: 102
},
bottomCSS: {
zIndex: 101
},
onopen: function (target) {
this.bottom.html(
$('img', target).attr('alt')
);
}
}); Btw, you don't need to change plugin's code, just use options. |
Thanks a lot, this works. |
Try this: var abigimage = $('a[href$=".jpg"]').abigimage({
boxCSS: {
zIndex: 102
},
bottomCSS: {
zIndex: 101
},
onopen: function (target) {
this.bottom.html(
$('img', target).attr('alt')
);
}
});
abigimage.img.bind('load', function() {
if (abigimage.img.height() > $(window).height() - abigimage.bottom.height()) {
abigimage.bottom.fadeOut('fast');
} else {
abigimage.bottom.fadeIn('fast');
}
}); |
Thank you, but this did not have any effect. If it's difficult to do, I could change the caption's background-color to the same as the overlay. It looks quite good, actually. |
Very much thanx for donation! 👍 It's received, just checked. I forgot that you using image borders, so just change var abigimage = $('a[href$=".jpg"]').abigimage({
boxCSS: {
zIndex: 102
},
bottomCSS: {
zIndex: 101
},
onopen: function (target) {
this.bottom.html(
$('img', target).attr('alt')
);
}
});
abigimage.img.bind('load', function() {
if (abigimage.img.outerHeight() > $(window).height() - abigimage.bottom.outerHeight()) {
abigimage.bottom.fadeOut('fast');
} else {
abigimage.bottom.fadeIn('fast');
}
}); |
This works, but if you turn your phone from portrait to landscape, (or from landscape to portrait) it doesn't affect the open image - you have to swipe to the next for the bottom div to disappear (or appear.) |
I have to trouble you with one more question - @media screen and (max-width:640px) { I've tried fiddling with the script, but I can't figure out the correct syntax. |
Use same function for image load event and window resize event. var abigimage = $('a[href$=".jpg"]').abigimage({
boxCSS: {
zIndex: 102
},
bottomCSS: {
zIndex: 101
},
imgAttrs: {
class: 'abigimage-img'
},
onopen: function (target) {
this.bottom.html(
$('img', target).attr('alt')
);
}
});
function adjustABigImageBottom() {
if (abigimage.img.outerHeight() > $(window).height() - abigimage.bottom.outerHeight()) {
abigimage.bottom.fadeOut('fast');
} else {
abigimage.bottom.fadeIn('fast');
}
}
abigimage.img.bind('load', adjustABigImageBottom);
$(window).bind('resize', adjustABigImageBottom); .abigimage-img {
border: 20px solid black;
border-bottom: 25px solid black;
}
@media screen and (max-width:640px) {
.abigimage-img {
border: 10px solid black;
border-bottom: 12px solid black;
}
} |
Now everything works perfectly! I'm really pleased. |
Thanx! I'm glad to help you. |
First of all, thank you for a great script. It's perfect for my use, and does almost everything I want out of the box.
There is one small problem - when the image fills the height of the viewport, the caption overlaps the image. I prefer the image to overlap the caption, so I gave the imgCSS a zIndex of 1000. This works on desktop browsers, but on my Android (4.2.2) phone it only works on the first image. Swipe to the next, and the problem is back. Is there any way to get around this?
(Swiping doesn't work properly with the Android Browser. You can swipe from the first image to the second, the second displays with no border, and stops reacting to touch)
I have a test page up at http://perberntsen.com/Test/metsa1.php
I should mention that I'm using Retina Images (https://github.com/Retina-Images/Retina-Images/) to load @2x images, and it seems to be working perfectly with ABigimage.
The text was updated successfully, but these errors were encountered: