JavaScript - Image Cross Fader Loading In Stack!
SOS, and thank you in advance. I've been going over the links, html and .js & .css files for a couple hours now and can't find the glitch...
the images are supposed to just cross fade and replace each other within the container space (sample at http://slayeroffice.com/code/imageCrossFade/xfade2.html), but are loading in a vertical column and then behaving strangely, making each one disappear as the cross fade occurs... even after a full cycle, it loads the next image on the list below the current. LINK to problem page/code: http://www.led-z.com/ Similar TutorialsIm using a image fader and this is the html. cant seem to link the image when i added href to it it stopped the fader working. Code: <script language="JavaScript"> // configuration structure var A_TPL = { 'random' : false, 'steps' : 20, 'transtime': 1.5, 'slidetime': 5, 'width' : 800, 'height': 278, 'alt' : 'BC banners', }; // IMAGE LINKS TO BE EDITED var A_ITEMS = [ 'http://www.******.co.uk/*****/img/banner1.jpg', 'http://www.******.co.uk/*****/img/banner2.jpg', 'http://www.******.co.uk/*****/img/banner3.jpg', 'http://www.******.co.uk/*****/img/banner4.jpg' ]; var mySlideShow = new tFader (A_ITEMS, A_TPL); </script> little help i've got a drop down menu and an image fader. i need the drop down menu to overlay on top of the fader. currently it drops down under it. i've tried messing about with z-index but not getting far. any ideas? thanks http://www.thebluebus.co.uk/tempwest/ Hi Everyone, I have just inherited a website which has a javascript menu tab and picture fader on the home page. This moves through 6 states changing a menu tab and main picture beneath to make it look like you're flicking through the menu yourself. This works perfectly, apart from the fact that every time the picture changes the page flicks back to the top. Very annoying if you have scrolled down are reading things at the bottom of the page!! The page uses jquery-1.2.3.pack.js. I am a PHP man just starting to learn Javascript and don't understand why it is doing this, can anyone help ??? The Relevant Code is: Code: <script> var scurrent_tab='tab1'; var scurrent_click_tab=''; var arTabsMain = new Array ( "tab1", "tab2", "tab3", "tab4", "tab5", "tab6", "bottomtab" ); function ChangeMainPictureClick(s) { bStopAutoLoad = true; ChangeMainPicture(s); } function ChangeMainPicture(s) { scurrent_click_tab = s; $("#tabs_content_container").fadeOut("slow", function() { $("#tabs_content_container").html($('#tabs_content_container_'+scurrent_click_tab).html()).fadeIn("slow"); } ); $('#main_tab_tab1_img').attr('src','images/tab_tab1_off.jpg'); $('#main_tab_tab2_img').attr('src','images/tab_tab2_off.jpg'); $('#main_tab_tab5_img').attr('src','images/tab_tab5_off.jpg'); $('#main_tab_tab4_img').attr('src','images/tab_tab4_off.jpg'); $('#main_tab_tab6_img').attr('src','images/tab_tab6_off.jpg'); $('#main_tab_tab3_img').attr('src','images/tab_tab3_off.jpg'); $('#main_tab_'+s+'_img').attr('src','images/tab_'+s+'_on.jpg'); scurrent_tab = s; } $('#main_tab_tab1').hover ( function(){$('#main_tab_tab1_img').attr('src','images/tab_tab1_on.jpg');}, function(){if(scurrent_tab=='tab1')return;$('#main_tab_tab1_img').attr('src','images/tab_tab1_off.jpg');} ); $('#main_tab_tab2').hover ( function(){$('#main_tab_tab2_img').attr('src','images/tab_tab2_on.jpg');}, function(){if(scurrent_tab=='tab2')return;$('#main_tab_tab2_img').attr('src','images/tab_tab2_off.jpg');} ); $('#main_tab_tab4').hover ( function(){$('#main_tab_tab4_img').attr('src','images/tab_tab4_on.jpg');}, function(){if(scurrent_tab=='tab4')return;$('#main_tab_tab4_img').attr('src','images/tab_tab4_off.jpg');} ); $('#main_tab_tab3').hover ( function(){$('#main_tab_tab3_img').attr('src','images/tab_tab3_on.jpg');}, function(){if(scurrent_tab=='tab3')return;$('#main_tab_tab3_img').attr('src','images/tab_tab3_off.jpg');} ); $('#main_tab_tab6').hover ( function(){$('#main_tab_tab6_img').attr('src','images/tab_tab6_on.jpg');}, function(){if(scurrent_tab=='tab6')return;$('#main_tab_tab6_img').attr('src','images/tab_tab6_off.jpg');} ); $('#main_tab_tab5').hover ( function(){$('#main_tab_tab5_img').attr('src','images/tab_tab5_on.jpg');}, function(){if(scurrent_tab=='tab5')return;$('#main_tab_tab5_img').attr('src','images/tab_tab5_off.jpg');} ); function AutoLoadTopic() { if(bStopAutoLoad) { window.setTimeout(function() {AutoLoadTopic();}, 8000); return true; } iCurrentSlide++; if(iCurrentSlide >= arTabsMain.length-1) iCurrentSlide = 0; ChangeMainPicture(arTabsMain[iCurrentSlide]); window.setTimeout(function() {AutoLoadTopic();}, 8000); } var bStopAutoLoad = false; var iCurrentSlide = 0; window.setTimeout(function() {AutoLoadTopic();}, 8000); </script> // ###### <script> $('#button_start_bottomtab').hover ( function(){$('#button_start_bottomtab_img').attr('src','images/start_bottomtab_pic_on.gif');}, function(){$('#button_start_bottomtab_img').attr('src','images/start_bottomtab_pic.gif');} ); </script> The code 'works' as in there are no issues in its functionality, I just want it work in a better way. Any help or ideas would be greatly appreciated. Just curious if anyone has a crossbrowser version of the Popup Image Viewer script that's in the Post a JavaScript section. Seems that all of the ones in there (original and modifications) are browser specific, whereas I need something that will work for all browsers, or at least IE and firefox.
Hi, I want to load an image when a user clicks a link on my page. The image is a tracking pixel for an affiliate network, so it doesn't need to be visible to the user (as it's not an image anyway but a php file). I assume this would use the onclick event. Can anyone help? My goal is to replace a 300px x 300px div with a random assortment of pictures, all being 300px x 300px. I however am not that great at JavaScript (I've taken a bigger bite than I can chew) and would love your guys' help. So far this is what I have for my JavaScript: Code: begin(); function begin() { setTimeout(newimage(),7000); } function newimage() { } Which brings me to my first question: What's the best method of pre-loading images? And also, if the method is not through JavaScript, how would I reference the image from the JavaScript? My next step would be to transition between images. (Fading specifically.) I really like the fade transition here and I plan on using that in the site. How would I incorporate that into my code? I noticed he made the entire JavaScript code into one line, which is quite annoying. Thanks guys! So I'm creating a game and decided to use a canvas for the map. The map is a big pictures 500kb+ (6400x6400px) and the canvas size is 320x320 so I am displaying only part of the image at a time and have the page reload on button click for database purposes. What I'd like help with is performance. Currently it's taking a few secs to reload every time and it seems that it causes some cpu strain (can't switch tabs while loading). Could I stop the canvas from reloading the image each time the page is reloaded and if so then how? Can I make the canvas only load a part of the image, if so then how? If neither is possible any tips, solutions how to solve the performance issues? Hi I have a script which dynamically adds contents to an HTML table using the jQuery's .after();... Now the problem the content is a bit too much and some times IE would crash, so I thought if a loading image would solve this issue? Any ideas? Thanks in advance Hi , Pls solve it Javascript problem. I have a page called gallery.html in which we have photo albums.when u click on one of the photo albums opens up all images belongs to that album on same page ( javascript). when click on one of the images it has to open up in a popup ( including other images) which is happening but the probleem is that when u close popup and again click on same images popup is happening but images are not loading. what might be the problem ..pls solve it .......its too urgent thanks in advance nagaraja kharvi Basically I want an effect like this: http://www.appelsiini.net/projects/l...ed_fadein.html Where the images on the page fade in as the user scrolls down. I implemented the code on a page, he http://www.jamiewebster.co.uk/orca.html Now, I have a couple of issues with this. First issue, it works in FF but it doesn't seem to work in Chrome. Second issue, I can see the alt text of the images below just above the fold of the page before the image loads (I guess it depends on your monitor size on wether you'll see it or not, but its still a problem!) Thirdly, it seems that once the images have loaded, if you scroll back up you no longer have the fade effect and it only happens once (unless you refresh the page) - would be good if that effect could happen every time you scroll. Any ideas, or if there is better code out there? Thanks in advance!! Hi, I am using a slideshow and want to basically have an 'image loading' whilst all the images load before the slideshow. Is there a way to do this? So far I have figured the best way around this is to have a GIF as a background image that says the loading message, and then once the slideshow loads over the top its fine, however im guessing this is'nt the right way to do this. I am using this slideshow set to just loop: http://www.dynamicdrive.com/dynamici...lslideshow.htm I am open to using other similar slideshows if there is one more suited. Thanks I have a form that used php to load a random image but now i would like to use javascript instead and am sure I nearly have it. I need to have a random number between 0 -5. Here is my code Code: <script type='text/javascript'> var random = Math.floor( Math.rand() * 6); document.write("<img src='images/'"+random+"'.jpg' alt='random image' /><input name='image' type='hidden' value='"+random+"' />") </script> ok. so i have all these big images and i need to let the whole page load before the viewer sees it what i would like is for a separate url (or something to completely cover the html page so you cant see it loading) to say please wait or something like that. Help! Hi! i am working on a facebook like photo viewer. I have used javascript to declare an array of about 200 images. I have the following approach to pre-load the images. I preload all the images when the page loads: HTML: <body onload = "lodpic()"> JAVASCRIPT: function lodpic() { for(i=0; i<=199; i++) { LODImage = new Image(); LODImage.src = picture[i]; } } The problem is the page tries to load all the images when opened. And when the user clicks "next" to view other photos, the other photo is still loading where as some are already loaded. I would like the code to be able to load the photo that the user is currently viewing as the user gets to that picture, before the page tries to finish loading all the photos. In other words, if the user wants to view a particular photo directly, that photo should get the priority of loading quickly. Or if there are other approaches, it would be really helpful. Thank you! When performing an Ajax request I want to change the submit button into a loading image and then swop it back again when the Ajax request is complete. I don't want a loading image anywhere else as on mobile phones it can't always be seen due to small screen size. I have grabbed the event (which references the form, is that right?) and I have something like this: Code: <button type="submit" name="name_can_vary">Search</button> event.name_can_vary.style.visibility = 'hidden'; //(obviously this isn't complete code but no doubt explains what I am talking about) ..which would hide the button and works exactly as I want to this point, but of course it does;t return when Ajax has completed or show the loading image. Ideally, instead of just hiding the button I want JavaScript to swop the button for the loading image. I suppose I could have extra HTML on every page that is made visible with the loading image but I would rather have JS do everything from here (saves editing all pages with submit buttons on). Thanks for any help. Hi, everyone. I've just finally adjusted the way that the background images is laid out. my problem is that the image seems to load in original size and then align to the screen's width. I'm using a javascript code that I got from http://stackoverflow.com/questions/1...g-aspect-ratio and it is working the way I want it to, mostly. My problem is that I'm not sure how to keep the image from exceeding 100% height of the windows without squashing the aspect ratio? I also need to figure out how to fix the visible action of the image being loaded in it's original size? If we can't get the image to load WHILE at the size I want it to be, can we at least 'hide' the image until the loading have been done? I tried to tweak the codes to include the height limitation but it did not seem to have made any differences. This is my first time actually using javascript so please be easy on me, heh My site is at http://www.lost-ear-studio.com (if you refresh the site, you will see random background images being swapped out using php). Code: <script> function resizeToMax(id){ myImage = new Image() var img = document.getElementById(id); myImage.src = img.src; if(myImage.width > myImage.height){ img.style.width = "100%"; } else { img.style.height = "100%"; } } </script> Code: <img id="bg" src="randombg.php" onload="resizeToMax(this.id)"> Code: #bg{ position:fixed; left:0px; top:0px; z-index:-1; } Hi, I am an asp.net developer and I wanted to display user popup (kind of) which freezes the screen so that user won't click anything else on the screen. There are some predefined controls in asp.net, but I wanted do this using Javascript. Where can I find a sample with code? Thanks Hello. I've recently implemented this really cool jQuery preloader called queryLoader. When a visitor comes to my site they are fed all the important images for the entire site (it's a very small site). During that time queryLoader shows a percentage loading animation, and once all the images are loaded it wipes the screen & displays the website. I've placed another custom animation in the "page loading" div, and i want to make sure it loads first so that it is displayed while the rest of the images get downloaded. I've tried pre-loading with javascript as the very first script in my header, before jQuery or queryLoader get loaded, like this: Code: <script type="text/javascript"> pic1= new Image(250,300); pic1.src="images/page_loading.gif"; </script> <script type="text/javascript" src="scripts/jQuery.js"></script> <script type="text/javascript" src="scripts/queryLoader.js"></script> However, this doesn't seem to be that effective. When i clear browser cache and reload the page, the page_loading.gif sometimes doesn't appear until the site is almost completely loaded. Is there a more effective way to assure the page_loading.gif gets loaded before any other images? My site is jugtones.com if that helps in any way. Thanks for your time, -Scott Hello everyone, well i have asked for alot of issues earlier but none completely got resolved i hope that i get answer for this one. I want something a script or anything that shows loading as we have seen .gif images, before the game loads. I went through google and tried alot of scripts but failed maybe i don't know the exact method how to implement it as i am weak in jquery or scripting. I would like some one to help me out as i don't know what to do thank you in advance. |