jquery - Get function parameter with url JavaScript -
well, got page load 3 galleries, , each gallery have "view gallery" button. everytime button clicked should load whole gallery in page. should call function loads whole gallery , redirect page images. can't make work. parameter of function passed through value of variable "x", don't know how put value in function, redirection work perfectly. this:
while(x <= 3){ imgs.innerhtml += "<div id='gal"+x+"' class='row'>"; imgs.innerhtml += "<div class='eight columns'>"; imgs.innerhtml += "<h4>galeria "+x+"</h4>" for(var = 0; <= 3; i++){ galeria[i] = "foto"+x+"_"+(i+1)+".jpg"; } for(var = 0; < galeria.length; i++){ imgs.innerhtml += "<img src='img/"+galeria[i]+"' class='imgs-galeria'>"; } imgs.innerhtml += "</div>"; imgs.innerhtml += "</div>"; imgs.innerhtml += "<a id='veja' href='pics.html' onclick='maisgaleria("+x+");'><div id='link'><p>veja mais</p></div>" //it loads page pics.html , send x value function. need start function value in pics.html, instead, load pics.html no images. x++;
}
the function:
function maisgaleria(n){ var galeria = new array(); var img = $("#gallery"); img.innerhtml = "<div class='row'>"; img.innerhtml = "<div class='six columns'>"; //imgs.innerhtml += "<h4>galeria"+n+"</h4>"; for(var = 0; <= 3; i++){ galeria[i] = "foto"+n+"_"+(i+1)+".jpg"; } for(var = 0; < galeria.length; i++){ img.innerhtml += "<img src='img/"+galeria[i]+"' class='imgs-galeria'>"; } img.innerhtml += "</div>"; img.innerhtml += "</div>"; }
the page pics.html
<body onload="maisgaleria();"> <div class="center"> <div class="row"> <div class="four columns top"> <h5></h5> </div> <div class="eight columns menu"> <ul> <a href="index.html"><li><h4 class="menu-list">home</h4></li></a> <a href="galeria.html"><li><h4 class="menu-list">galeria</h4></li></a> <a href="sobre.html"><li><h4 class="menu-list">sobre</h4></li></a> <a href="contato.html"><li><h4 class="menu-list">contato</h4></li></a> </ul> </div> </div> <div class="row galeria"> <div id="gallery" class="container"> </div> </div> <div class="row"> <div id="footer"> <div class="four columns"> <h4></h4> </div> <div class="eight columns img-footer" id="social"> </div> </div>
Comments
Post a Comment