JavaScript - Lightbox Problem Once I Update, Out Of Nowhere?
I have been working on a site for some time and only yesterday did something happen which wont upload these two images I replaced in my lightbox run through:
here is the page: http://newghost.net/GRAPHICS.html The last image wont come up(just a white box) and the five image wont change to the new edited image. I made sure the text and images were all directly linked, the code was checked etc. All I did was replace the images, edited the images. One thing I did notice that was different was it says (run script) : ( Void) or something similar to that at the bottom left corner of the browser on all the images that are working but not on the last.--(??) Is there something I should do with this? its the only clue I have. I have been trying to get some fresher stuff up for a client I referred. Now I am afraid that they won't see the work... sigh...:/ I spent several hours yesterday trying to figure it out... but I wont give up. Is there a problem with my server? Is there some update that threw everything off? I am afraid to update anything more.... Any help would be greatly appreciated! Thanks! Similar Tutorialsi made a gallery using lightbox but i have a problem that the menu (created by allwebmenu program) is always on top of the lightbox so the pictures i cutted.. how to solve this problem? Hei! I am trying to use a contact form which appears in a lightbox from : http://www.xul.fr/javascript/lightbox-form.html It is working great but, of course I have a problem. My page is very big and when I want my page to scroll to the point where the form is. I am using window.scrollTo function. the problem is that before scrolling to that point , it automatically scrolls to the coordinates (0,0) and only after that. I am posting my javascript and css code. Thanks for your help ! JAVASCRIPT Code: function gradient(id, level) { var box = document.getElementById(id); box.style.opacity = level; box.style.MozOpacity = level; box.style.KhtmlOpacity = level; box.style.filter = "alpha(opacity=" + level * 100 + ")"; box.style.display="block"; if(id=='boxa') { window.scrollTo(2500,0); } else { window.scrollTo(100,100); } return; } function fadein(id) { var level = 0; while(level <= 1) { setTimeout( "gradient('" + id + "'," + level + ")", (level* 1000) + 10); level += 0.01; } } function openbox(formtitle, fadin,boxtitle,boxN) { var box = document.getElementById(boxN); document.getElementById('filter').style.display='block'; //var btitle = document.getElementById(boxtitle); // btitle.innerHTML = formtitle; // var btitle = document.getElementById(boxtitle); // btitle.innerHTML = formtitle; if(fadin) { gradient(boxN, 0); fadein(boxN); } else { box.style.display='block'; } } // Close the lightbox function closebox() { document.getElementById('box').style.display='none'; document.getElementById('filter').style.display='none'; document.getElementById('boxa').style.display='none'; document.getElementById('filter').style.display='none'; } CSS Code: #filter { display: none; position: absolute; top: -500px; left: -500px; width: 7200px; height: 3300px; background-color: #000; z-index:10; opacity:0.5; filter: alpha(opacity=50); } #box { display: none; position: absolute; top: 20%; left: 20%; width: 400px; height: 200px; padding: 48px; margin:0; border: 1px solid black; background-color: white; z-index:101; overflow: none; } #boxtitle { position:absolute; float:center; top:0; left:0; width:496px; height:24px; padding:0; padding-top:4px; left-padding:8px; margin:0; border-bottom:4px solid #3CF; background-color: #09c; color:white; text-align:center; } #boxa { display: none; position: absolute; top: 350px; left: 2950px; width: 700px; height: 200px; padding: 48px; z-index:101; overflow: visible; /* background-image: url(../imagini/tutorial.png); */ background-repeat:no-repeat; } Hello. This is very long and I think if you look at code it might be quicker. If not, then please read along. Here is the code and the problem: Code: function addtwoboxes { get values from two text boxes, one about width, the other one about height, and store each in a variable; a=width; b=height checkifwidthproblem(); //to see if the boxes are empty and with numbers checkifheightproblem(); //to see if the boxes are empty and with numbers if (width_not_ok==false && height_not_ok==false) { Go Ahead and do calculations and other things } function checkifwidthproblem() { width_not_ok=false; if problems with the data in the textbox (the a variable is being checked). { bring up an alert box width_not_ok=true; } } //end of checkifwidthproblem function function checkifheightproblem() { height_not_ok=false; if problems with the data in the textbox (the b variable is being checked) { bring up an alert box height_not_ok=true; } } //end of checkifheightproblem function I would like this function to be setup the same way as the addtwoboxes function, but right now I am only calling up the checkifwidthproblem function, and it doesn't execute and the form gets submitted. The fillInvoiceNumber function can be called because if I place only an alert of Hello in it, it comes up, and then the form gets submitted. If it do get this working, I would also need to be sure that it is seeing the results of the variables width_not_ok and height_not_ok, just as they are for the addtwoboxes function. function fillInvoiceNumber() checkifwidthproblem(); //to see if the boxes are empty and with numbers checkifheightproblem(); //to see if the boxes are empty and with numbers if (width_not_ok==false && height_not_ok==false) { Go Ahead and do calculations and other things ] This is going to be a bit long, but it's the only way I can be sure of that I have covered everything, so please bear with me and help me out. Thanks. Please Provide Solution Using my way First, Then suggest Better Ways: O.k. Before I post the problem, I know, since I took program classes years ago and since I have done a little research here and here, that there are better, more efficient, and tidier ways to do what I am doing, but I have started already this way and would like to continue this way. I will ask what's the better way to do this in another thread, unless 1) you feel like explaining the bettery way and 2) it's not too long or complicated, but AFTER you have provided me with a solution to doing it my way. The Setup / What My Form is Supposed to Do: I have a form with two buttons. The user has to enter some information into the form and then click the button to have some calculations done and for other text fields to automatically filled in. After that, the user has to click submit. A note about the submit button: The type is image and the name says submit. The form line has the following: <form target="abcco" action="https://www.domainname.com" method="post" id="Form" onsubmit="fillInvoiceNumber()"> I will explain what the fillInvoiceNumber() is doing later on. Data Validation / Verification: 1) I want to ensure that when the user clicks the first button, let's call it GetPrices to make things easier, that it checks to see if data is enterted into the textboxes and that it is the right kind of data. 2) After the GetPrices button is clicked, the user can then enter nonsense into the textboxes and click submit or, never click the GetPrices button, the first button to begin with, and so junk will be submitted. This is what I have going on: For the GetPrices button, I have the following: onclick="addtwoboxes() (the names I have aren't fully descriptive of all that's going on, as I do have more things happening, but for now I have left them like that). in the addtwoboxes function I have it calling up two functions, each for a textbox in which the user has to enter width in one and height in another, and if the textboxes are not empty and have the correct data in them, then the calcuations for the addtwoboxes take place; if not, nothing happens (regarding the calculations; an alert box comes up for either or both of the functions in the addtwoboxes function if something is wrong). So, the two functions that are called in the addtwoboxes() function are checkifwidthproblem() checkifheighthproblem() which I am calling just like that but with a semicolon to the end of each one. This next now is one of the areas where I do believe this can be combined, since only one value is changing, but I will leave it like this for now. The checkifwidthproblem() function starts of with a variable:width_not_ok=false; (after doing some research, I see that this is often set the opposite way or not set at all) if something is wrong with the data entered into the width textbox, an alert box with a message comes up, and I then have the following variable: width_not_ok=false; For the checkifheighthproblem(), it's basically the same as the width problem, except, with it's own set of variables. I had the same ones as the width one, but if things were not ok with the width textbox, but o.k. with the height textbox, the calculations were taking place. So, because of this I used new variables in the height function and had an if statement check both variables for false. So, the checkifheighthproblem() starts of with the variable: height_not_ok=false and if there is a problem with the data entered into the height textbox, an alert box comes up and the variable height_not_ok=true is set. When the user presses the GetPrices button, this function works excellently. Everything goes as it should. The problem is when the form is being submitted. I would like the textboxes to be rechecked. So, right now I have a function called fillInvoiceNumber() in which it is joining two strings together after getting their values from a drop down menu. This has to be done at the time of submission only for the page that's processing the results to have them interpreted the way I want it to. Prior to joining those strings, I would like it check and see if everything is o.k. with the two textboxes by calling the two functions of that check height and width and if they are not, for the alert boxes to come up, for the joining of the strings to not take place, and for the form to not be submitted. However, the fillInvoiceNumber() function is not executing either function at all. If it does work, I would also need to be sure that it is seeing the results of the variables width_not_ok and height_not_ok. can some tell me how this image gallery with lightbox is done? I am trying to figure this out and was searching, but couldn't find how this was implemented with lightbox. http://www.davirusso.com/work/ Hi, could someone please tell me what I'm doing wrong with this page? http://www.silvergatehomes.com/customhomestest.html I've tried a bunch of things and cannot figure out what I'm doing wrong. Thanks. P.S. The reason I'm writing is because the images aren't opening. http://www.fotoderyadijital.somee.co...cekimleri.html why my gallery is too slow when i double click the image is it about lightbox script or images is too big size. can you check for me. I am making a simple lightbox without using the silly plugins and I want to know how to make the lightbox resize equally when its being loaded. I can only get it expand from the corner, I want it to stretch down then widen but equally on both sides. this is the code im using: Code: // Javascript <script language="javascript"> $(function(){ $("a#show-panel").click(function(){ $("#lightbox, #lightbox-panel").animate({"height" : "400px"},2000); $("#lightbox, #lightbox-panel").animate({"width" : "400px"},2000); }); $("a#close-panel").click(function(){ $("#lightbox, #lightbox-panel").fadeOut(300); }); }); </script> // CSS #lightbox { display:none; background:#000000; opacity:0.9; filter:alpha(opacity=90); position:absolute; top:0px; left:0px; min-width:100%; min-height:100%; z-index:1000; } #lightbox-panel { display:none; position:fixed; top:100px; left:50%; margin-left:-200px; background:#FFFFFF; padding:10px 15px 10px 15px; border:2px solid #CCCCCC; z-index:1001; } // HTML <a id="show-panel" href="#" class="small">Show Panel</a> <div id="lightbox-panel"> <h2>Lightbox Panel</h2> <p>You can add any valid content here.</p> <p align="center"> <a id="close-panel" href="#" class="small">Close this window</a> </p> </div><!-- /lightbox-panel --> <div id="lightbox"> </div><!-- /lightbox --> I've never done java script, but I need this lightbox effect and I can never figure it out! http://www.youtube.com/watch?v=_Vv0QVP2CzE there's one tutorial I tryed, but for some reason, the light box never works, it always just opens in a new window. The website I got the codes from http://www.lokeshdhakar.com/projects/lightbox2/#how says that if it doesn't work there must be a conflicting code, but I don't have anything that I would see that would be conflicting this. I'm just trying to get a simple effect on a tutorial website I am creating so you can click the image and it enlarges in the lightbox. Can anyone help me out here? I really would like to figure out this effect. Thanks Hi, I am using Lightbox+ and overall it's very good for my needs. However it has a small problem that is causing me to loose hair, I have tried to fix it but my grasp of Javascript just isn't cutting it. If you goto http://serennz.sakura.ne.jp/toybox/lightbox/ and click on the image "Sample 2" then use the next arrow to go to "Sample 3" you have to hover off the image and then back on to get the previous and zoom icons to show again. I have been able to make the bug occur every time in both Firefox 3.6 and IE6. I am guessing the mouseover event isn't triggering correctly due to the image object moving underneath the mouse pointer but I just can't fix it. Any help, pushes in the right direction, anything. Cam. Hello. Am I missing any coding or anything? I'm really confused and have yet to find any help. I got the instructions from http://www.huddletogether.com/projects/lightbox2/ I would go to their forums but haven't received an approval email for over a week. Odd. Anyway, here is my link with the sample thumbnail. It opens the image in a new page. Thanks! http://creativepink.net/packaging.php Figured it out... admin can delete.
Hi for some reason my lightbox, downloaded from (huddletogether/projects - Lightbox 2) isn't working. I have a javascript slider that IS working on the page aswell You can view a test page here http://www.spmcreative.co.uk/patrickedward/gallery.html (only the first thumbnail is clickable) I have attached some code below, please let me know if you need to see any more, Code: <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Patrick Edward Diamonds</title> <link rel="stylesheet" href="CSS/style.css" type="text/css" /> <link rel="stylesheet" href="CSS/screen.css" type="text/css" media="screen" /><br /> <link rel="stylesheet" href="CSS/lightbox.css" type="text/css" media="screen" /> <script src="js/prototype.js" type="text/javascript"></script> <script src="js/scriptaculous.js?load=effects,builder" type="text/javascript"></script> <script src="js/lightbox.js" type="text/javascript"></script> <style type="text/css"> body { background-image: url(img/MainBG.gif); background-repeat: repeat; } a:link { color: #999; text-decoration: none; border:0; } a:visited { text-decoration: none; color: #999; border:0; } a:hover { text-decoration: none; color: #000; border:0; } a:active { text-decoration: none; border:0; } </style> </head> <body> <div id="container"> <div id = "header"> <div class = "logo"> <a href="index.html"> <img src="img/logo.png" alt ="Patrick Edward Diamonds" /> </a> </div> <ul id="nav"> <li><a href="index.html"> Home |</a></li> <li><a href="collections.html"> Collections |</a></li> <li><a href="design.html"> Design Service |</a></li> <li><a href="trade.html"> Trade Service |</a></li> <li><a href="gallery.html"> Design Gallery |</a></li> <li><a href="contact.html"> Contact Us</a></li> </ul> </div> <!--end of header--> <div class="main_view"> <div class="window"> <div class="image_reel"> <a href="#"><img src="img/reel_1.jpg" alt="" /></a> <a href="#"><img src="img/reel_2.jpg" alt="" width="780" height="245" /></a> <a href="#"><img src="img/reel_3.jpg" alt="" /></a> <a href="#"><img src="img/reel_4.jpg" alt="" /></a> </div> </div> <div class="paging"> <a href="#" rel="1"><img src="img/bullet.png" alt="" /></a> <a href="#" rel="2"><img src="img/bullet.png" alt="" /></a> <a href="#" rel="3"><img src="img/bullet.png" alt="" /></a> <a href="#" rel="4"><img src="img/bullet.png" alt="" /></a> </div> </div> <!--end of banner--> <div id="main1"> <p><img src="img/gallery.png" alt="Gallery" /></p> <div class="album"> <div class="imageSingle"> <div class="image"><a href="img/Lgallery1.jpg" rel="lightbox" title="my caption"><img src="img/gallery1.jpg"/></a></div> </div> Thanks, Simon I need help i have "installed" everything for lightbox and it runs but how 1 can i make it to click on a image and then open the light box and how can i get it over the frame?! Please and thanks... If you don`t know what i mean check out rebel-renee.com - Media-Lounge galerie... Hey guys, I'm new to the forum and thought I should sign up to learn a little more. I am trying to work on a lightbox for my personal portfolio site which opens up numerous images in one lightbox that you can scroll through. However, I want thumbnails below the main image too. The following link shows exactly what I mean, just click on one of the images... http://www.weareunit.com/index.php?p=3D Thanks Hello, this is not and advert This is a class i built in javascript What it dose: When users leave a site that has a confirm you want to leave box from the browser Why have i posted: I have seen around on the internet posts about how to do such a thing so i though i would get hits to codding forum when user search for such a thing and any one of codding forum members could help it get better Well this is a nice little object to use insted that dose a light box effect and brings up a Yes/no true/false box you set what you want it to say The JSON Object PHP Code: confirmBox = { 'message' : 'This is a Confirm Box', 'trueTxt' : 'True', 'complete' : true, 're' : '', 'falseTxt' : 'False', 'onTrue' : 'alert("true")', 'onFalse' : 'alert("false")', 'setTrue' : function(ontrue){ this.onTrue = ontrue + "confirmBox.update('true')"; }, 'setFalse' : function(onfalse){ this.onFalse = onfalse + "confirmBox.update('false')"; }, 'setTrueText' : function(trueText){ this.trueTxt = trueText; }, 'setFalseText' : function(falseText){ this.falseTxt = falseText; }, 'setText' : function(text){ this.message = text; }, 'hide' : function(){ var bg = document.getElementById('___confirmBox_bg'); var center = document.getElementById('___confirmBox_center'); var dialog = document.getElementById('___confirmBox_dilog'); center.removeChild(dialog); bg.removeChild(center); document.body.removeChild(bg); }, 'show' : function(){ this.createBG(); this.createCenter(); this.createDialog(); }, 'update' : function(sw){ this.re = sw; }, 'state':function(){ if(this.re = ''){ return false; }else{ return this.re; } }, 'createBG' : function(){ var bg = document.createElement("div"); bg.setAttribute('style', "display: table; position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index:1001; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80);"); bg.setAttribute('id', '___confirmBox_bg'); document.body.appendChild(bg); }, 'createCenter' : function(){ var center = document.createElement('div'); center.setAttribute('style',"#position: absolute; #top: 50%; display: table-cell; vertical-align: middle; margin-left:auto; margin-right:auto;"); center.setAttribute('id', '___confirmBox_center'); document.getElementById('___confirmBox_bg').appendChild(center); }, 'createDialog' : function(){ var dialog = document.createElement('div'); dialog.setAttribute('style', "display:block; width: 300px; padding: 16px; background-color: white; z-index:1003; margin-left:auto; margin-right:auto;"); dialog.setAttribute('id', '___confirmBox_dilog'); dialog.innerHTML = this.message + '<div align="right"><input type="button" onclick="eval(confirmBox.onTrue); confirmBox.hide();" value="' +this.trueTxt + '" /><input type="button" onclick="eval(confirmBox.onFalse); confirmBox.hide();" value="' + this.falseTxt + '" /></div>'; document.getElementById('___confirmBox_center').appendChild(dialog); }, } Then this is how you call it and set propertys Code: <script src="confirmBox.js" type="text/javascript"></script> <script type="text/javascript"> confirmBox.setText("This is a test"); //Sets the text to show in the box confirmBox.setTrueText("I can see it"); // sets the text on the return true button confirmBox.setFalseText("I can't see it"); // sets the text on the return false button confirmBox.setTrue('alert("Thanks");'); //what to do when true is clicked confirmBox.setFalse('alert("Your a lier");');// what to do when false is clicked confirmBox.show(); // Show the confirmBox </script> Hi, I have tried lightbox2 and jquery lightbox and I have the same problem with both. I have added the javascripts and css files for the lightbox. This is my code: <a href="getsnap.php?id={$user.id}&typ=full&picid={$pic.picno}" rel="lightbox" title="TITLE"><img src="getsnap.php?id={$user.id}&typ=tn&picid={$pic.picno}" width="45" height="45" alt="" /></a> The problem hee is when you click on the image, it want you to save the file to your computer and not use the lightbox effect. I have to put the image through getsnap.php?etc.... Any ideas? I really like the lightbox2 effect (http://www.huddletogether.com/projec...tbox2/#example) but I need help doing what I'm trying to do, for some reason I cannot get it to work, maybe you have a better recommendation? I have one large image, its a tear out of a magazine, I want the initial image to be the entire page, but I want the user to be able to click on the text area of the page and have that enlarge so the viewer can read it clearly. Any ideas? Thank you, Dustin Hey folks, I'm working on a complete recode of my website and I would love to use a lightbox for my image gallery. I've been trying to research different lightboxes and have so far found it quite the runaround. Could anyone recommend one? I'm just looking for one with simple implementation that allows for a single image to be displayed with closing and forward/backward functions for clicking through the different images in the gallery. If anyone wants/needs more info, please let me know. Thanks in advance. I have been following a tutorial for an image gallery, i can upload images and use gd to create thumbnails that when clicked display the full sized image, but the full sized image is to big to fit in my design, i have managed to get the rel="lightbox" attached to the thumbnails as they are displayed but it wont load the full image, the loading ring just keeps going round, does anybody know how to fix this? is it even possible. BTW i am a complete beginner so please be gentle.
|