| dhteumeuleu forums / English / How to change "forgotten world" gallery |
| Author | Message |
| bezkitu Member |
# Posted: 8 May 2008 10:09 Hello. First of all i want to thanks for awesome work
My question is: how to change quantity of photos in "forgotten world" gallery . I have try to change .js file but im noob in JS . I need for example 8 photos per page. If somebody can help me i will be very thankfull. |
| ge1doot |
# Posted: 8 May 2008 15:09 · Edited by: ge1doot Hi, The gallery structure is hardcoded...
Anyway, for 8 photos, here is the code : /* ==== creates 3D structure ==== */ for (var i = 0; i < 8; i++) { /* ==== central lights ==== */ r3D.O.push( r3D.addImg(0, 300, (i * .5) * r3D.nh * .75, 10) ); var i1 = (i < 4 ? -1 : 1) * r3D.nw * .25; var i2 = (i < 4 ? i : i - 4) * r3D.nh * .75; r3D.O.push( r3D.addImg(i1, 150, i2, 11, .5) ); r3D.O.push( r3D.addImg(i1, 0, i2, i) ); } and remove the image IDs in the HTML <div id="images" style="visibility:hidden"> <!-- left --> <img alt="" src="../images/image1.jpg"> <img alt="" src="../images/image3.jpg"> <img alt="" src="../images/image5.jpg"> <img alt="" src="../images/image7.jpg"> <!-- right --> <img alt="" src="../images/image2.jpg"> <img alt="" src="../images/image4.jpg"> <img alt="" src="../images/image6.jpg"> <img alt="" src="../images/image8.jpg"> <!-- lamps --> <img alt="" src="../images/Glob44.gif"> <img alt="" src="../images/dg3.jpg"> <img alt="" src="../images/glo4.gif"> </div> hope this helps ![]() |
| bezkitu Member |
# Posted: 8 May 2008 15:14 Unfortunatly it's not working
I think that i change every 5 for 4 and 10 for 8 in all combination and if i change anything i have "loading" screan all time thx anyway |
| ge1doot |
# Posted: 8 May 2008 15:18 then, you introduced another bug not related to this modif... ![]() |
| bezkitu Member |
# Posted: 8 May 2008 15:36 Its the js script: // ================================================== // ===== 3D DHTML gallery ==== // script written by Gerard Ferrandez - March 2007 // http://www.dhteumeuleu.com // It's all in the pixels... // ================================================== var r3D = { O : new Array(), xm : 0, ym : 0, FL : 300, // focal length cx : 0, cz : 0, cr : 0, run : function () { /* ==== sky color ==== */ var c = Math.round(Math.max(0, (196 - Math.abs(r3D.cx)) * .5)); r3D.scr.style.backgroundColor = "RGB(".concat(c, ",", c, ",", c, ")"); /* ==== camera position & rotation ==== */ r3D.cx -= Math.round((r3D.xm + r3D.cx) / 10); r3D.cz += Math.round((r3D.ym - r3D.cz) / 10); r3D.cr = -r3D.cx / 200; /* ==== 3D calcul ==== */ for (var i = 0, o; o = r3D.O[i]; i++) o.display(); setTimeout(r3D.run, 16); }, addImg : function (x, y, z, i, alpha) { /* ==== creates Image Element ==== */ var o = document.createElement('img'); var img = document.getElementById("images").getElementsByTagName("img")[i]; o.src = img.src; o.W = img.width; o.H = img.height; o.X = x; o.Y = y; o.Z = z; /* ==== transparency ==== */ if (alpha) { o.style.filter = "alpha(opacity=" + (alpha * 100) + ")"; o.style.opacity = alpha; } r3D.scr.appendChild(o); /* ==== main 3D function ==== */ o.display = function () { var x = this.X - r3D.cx; var y = this.Y; var z = this.Z - r3D.cz; var a = Math.atan2(z, x); var d = Math.sqrt(x * x + z * z); x = Math.cos(a + r3D.cr) * d; z = Math.sin(a + r3D.cr) * d; /* ==== element visible ==== */ if (z > -r3D.FL * .9) { var r = r3D.FL / (r3D.FL + z); var w = this.W * r * r3D.Z; var h = this.H * r * r3D.Z; this.style.left = ''.concat(Math.floor((r3D.nw * .5) + (x * r) - (w * .5)), 'px'); this.style.top = ''.concat(Math.floor((r3D.nh * .5) + (y * r) - (h * .5)), 'px'); this.style.width = ''.concat(Math.ceil(w), 'px'); this.style.height = ''.concat(Math.ceil(h), 'px'); this.style.zIndex = Math.round(10000 - z); } else this.style.width = '0px'; } return o; }, init : function () { r3D.scr = document.getElementById('screen'); resize(); /* ==== creates 3D structure ==== */ for (var i = 0; i < 8; i++) { /* ==== central lights ==== */ r3D.O.push( r3D.addImg(0, 300, (i * .5) * r3D.nh * .75, 10) ); var i1 = (i < 4 ? -1 : 1) * r3D.nw * .25; var i2 = (i < 4 ? i : i - 4) * r3D.nh * .75; r3D.O.push( r3D.addImg(i1, 150, i2, 11, .5) ); r3D.O.push( r3D.addImg(i1, 0, i2, i) ); } /* ==== moon ==== */ r3D.O.push( r3D.addImg(0, -1000, r3D.nh * 5, 12) ); /* ==== zyva ==== */ document.getElementById('ground').innerHTML = " "; r3D.run(); }, /* ==== screen resize ==== */ resize : function () { r3D.nx = r3D.scr.offsetLeft; r3D.ny = r3D.scr.offsetTop; r3D.nw = r3D.scr.offsetWidth; r3D.nh = r3D.scr.offsetHeight; r3D.Z = r3D.nw / 2000; }, /* ==== mouse position ==== */ mousemove : function (e) { if (window.event) e = window.event; r3D.xm = -r3D.nx + e.clientX - r3D.nw * .5; r3D.ym = -r3D.nh + e.clientY * 4.5; } } /* ==== global events ==== */ function resize() { r3D.resize(); document.onmousemove = function(e) { r3D.mousemove(e); } } onresize = resize; onload = function () { setTimeout( r3D.init, 1000 ); } i think its ok, html is: <div id="screen"> <div id="ground" style="position:absolute;top:50%;left:0px;width:100%;height:50%;backgr ound:transparent;font-size:0.9em;font-family:arial;color:#fff;text-ali gn:center">Loading...</div> </div> <div id="images" style="visibility:hidden"> <!-- left --> <img alt="" src="img/jumperg/11.jpg"> <img alt="" src="img/jumperg/12.jpg"> <img alt="" src="img/nostuff.gif"> <img alt="" src="img/nogirl.gif"> <!-- right --> <img alt="" src="img/jumperg/13.jpg"> <img alt="" src="img/jumperg/14.jpg"> <img alt="" src="img/jumperg/15.jpg"> <img alt="" src="img/nogirl.gif"> <!-- lamps --> <img alt="" src="img/Glob44.gif"> <img alt="" src="img/dg3.gif"> <img alt="" src="img/glo4.gif"> </div> so i think its also ok.. i'm worry that this awesome script is simply not for me hehe ![]() |
| Mike Member |
# Posted: 24 Sep 2008 00:56 Hi All, I have been attempting to modify this and scale it out. For now I am trying to go to 20 images total, until I can learn what needs to be changed and then eventually scale it out to 300+ images. http://mikedeanellis.com/wallpapers Here is where I am at currently. I get the 20 images to show up correctly, but not the moon, holder image or little moons. Surely there is somewhere in this code to adjust for that? I really appreciate your help! |
| damir Member |
# Posted: 14 Aug 2009 11:52 I get the 20 images to show up correctly, but not the moon, holder image or little moons. Surely there is somewhere in this code to adjust for that? Hi, something find a solution for this? Thank's |
|
Powered by miniBB forum software © 2001-2009 |