| Autor | Zpráva | ||
|---|---|---|---|
| casy Profil |
#1 · Zasláno: 28. 1. 2013, 16:27:07
Ahoj,
potřeboval bych poradit jak upravit galerii tak aby se fotky neposouvaly při kontaktu s kurzorem, ale aby se posunovaly po kliknutí na další obrázek. Script js <script type="text/javascript">//<![CDATA[
$(function(){
$(window).load(function(){
// roXon mmGallery
MouseRelXpos = 0;
sumW = 0;
// auto-SET mmGallery_container WIDTH ()
$('#mmGallery img').each(function(){
sumW += $(this).width(); // collect all images widths
$('#mmGallery').width(sumW);//SET gallery WIDTH!
});
// Calculate 'compensation speed': width difference between the gallery container and the gallery
wDiff1 = $('#mmGallery_container').width();
wDiff2 = $('#mmGallery').width();
wDiff = (wDiff2/wDiff1)-1; //(-1 is for the already existant container width)
//#
$("#mmGallery_container").mousemove(function(e) {
MouseRelXpos = (e.pageX - this.offsetLeft); // = mouse pos. 'minus' offsetLeft of this element
});
var xSlider = $("#mmGallery"); // cache
var posX = 0;
setInterval(function(){
posX += (- MouseRelXpos - posX) / 14; // 14 = speed (higher val = slower animation)
xSlider.css({marginLeft: Math.round(posX * wDiff) +'px' }); // instead 'marginLeft' use 'left' for absolute pos. #mmGallery
}, 10); // 10 = loop timeout
});
});//]]>
</script>a html <div id="mmGallery_container"> <div id="mmGallery"> <img src="source/upload/gallery/obleceni-laskara-1.jpg"/> <img src="source/upload/gallery/obleceni-laskara-2.jpg"/> <img src="source/upload/gallery/obleceni-laskara-3.jpg"/> <img src="source/upload/gallery/obleceni-laskara-4.jpg"/> <img src="source/upload/gallery/obleceni-laskara-5.jpg"/> <img src="source/upload/gallery/obleceni-laskara-6.jpg"/> <img src="source/upload/gallery/obleceni-laskara-7.jpg"/> <img src="source/upload/gallery/obleceni-laskara-8.jpg"/> <img src="source/upload/gallery/obleceni-laskara-9.jpg"/> <img src="source/upload/gallery/obleceni-laskara-10.jpg"/> <img src="source/upload/gallery/obleceni-laskara-11.jpg"/> <img src="source/upload/gallery/obleceni-laskara-12.jpg"/> </div> </div> Moc děkuji za rady Dan |
||
| casy Profil |
#2 · Zasláno: 29. 1. 2013, 13:27:57
Vyřešeno.
|
||
| jenikkozak Profil |
#3 · Zasláno: 29. 1. 2013, 14:04:12
casy:
„Vyřešeno.“ To je dobře. Jak jsi to vyřešil? |
||
|
Časová prodleva: 17 dní
|
|||
| casy Profil |
#4 · Zasláno: 15. 2. 2013, 16:36:22
jenikkozak:
použil jsem jinou galerii - nivoslider |
||
|
Časová prodleva: 14 let
|
|||
Toto téma je uzamčeno. Odpověď nelze zaslat.
0