JavaScript - Lightbox Won't Open On Ie8 (js Error Pops When You Click The Image) Virtuemart+joomla
Hello there.
I'm using Joomla 1.5 and VirtueMart for my e-shop. I've also installed a virtuemart template which loads mootools. Well in my virtuemart product detail pages, if you click the main image to make it enlarged using IE8 it will not open and return a JS error instead (found it using Firebug): http://goo.gl/6lQCV Code: Message: 'closeButton' is null or not an object Line: 21 Char: 63 Code: 0 URI: http://www.xxxxx.xxx/media/system/js/mootools.js I'm not sure but I think that if I fix the JS errors on these pages the problem will be solved and the images will open normally. Note that on all other browsers it works fine (Firefox, Chrome, Safari, IE9). The page returns some other errors too but they're the whole time there. I think there's a conflict caused by all the JS libraries loaded by my Plugins (System - RokBox & YOOeffects), Joomla template, VirtueMart & VirtueMart template (jquery and mootools are both loaded). Thanks in advance Similar TutorialsI am getting error when using the script below in vm mynxx template by rockettheme in virtuemart Joomla 1.5 - It works fine outside of mynxx User inputs data into a html form- presses "Get Price" button and a price is returned to same form. Problem is that user is unable to submit to cart firebug error - callback is not a function callback(this.responseText); my ajax script Code: function Ajax() { this.instance = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); this.request = function(url, callback) { this.instance.open('GET', url, true); this.instance.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { callback(this.responseText); } } this.instance.send(null); } } function validate(form) { (new Ajax).request('testform.php?width65=' + form.width65.value + '&length65=' + form.length65.value, function(respons) { var prices = eval(respons); form.price.value = prices[0]; form.otherprice.value = prices[1]; }); } I think I have tracked the file down to theme.js and require some code to validate the function. I am new at this and this is way above me - any help would be appreciated Theme.js code - was packed - ie eval(function(p,a,c,k,e,r){e=function(c)...... I have unpacked it Code: var RokVM = {}; RokVM.autoHide = 3; // seconds before auto closing the Panel RokVM.Base= { uri:window.templatePath,start:function() { RokVM.Base.quantityBox(); RokVM.Cart.init() } ,featuredHeight:function(b) { b=$(b); if(!b) { return RokVM.Base } var c=b.getElements(".home-featured-inner"); var d=0; c.each(function(a) { d=Math.max(a.getSize().size.y,d) } ); c.setStyle("height",d) } ,quantityBox:function() { var h=$$(".cart-quantity-box, .home-featured-cartblock"); if(h.length) { h.each(function(b) { var c=b.getElement(".quantity_box_button_up"); var d=b.getElement(".quantity_box_button_down"); var f=b.getElement(".inputboxquantity"); if(!c||!d||!f) { return } var g=f.getValue().toInt(); f.addEvent("keyup",function(e) { e=(new Event(e)).stop(); var a=this.value; if(a<0) { a=0 } if(isNaN(a)) { this.value=1; a=1 } if(e.key=="up") { if($type(this.getValue().toInt())=="number") { this.value=++a } } if(e.key=="down") { if(a>0&&$type(this.getValue().toInt())=="number") { this.value=--a } } } ); f.addEvent("mousewheel",function(e) { e=(new Event(e)).stop(); var a=this.value; if(a<0) { a=0 } if(isNaN(a)) { this.value=1; a=1 } if(e.wheel==1) { if($type(this.getValue().toInt())=="number") { this.value=++a } } if(e.wheel==-1) { if(a>0&&$type(this.getValue().toInt())=="number") { this.value=--a } } } ); c.addEvent("click",function(e) { (new Event(e)).stop(); if($type(f.getValue().toInt())=="number") { f.value=++f.value } } ); d.addEvent("click",function(e) { (new Event(e)).stop(); if(f.getValue().toInt()>0&&$type(f.getValue().toInt())=="number") { f.value=--f.value } } ) } ) } } }; RokVM.Cart= { init:function() { RokVM.Cart.cartPanel=$("cart-panel"); RokVM.Cart.cartButton=$("cart-button"); RokVM.Cart.cartSurround=$("cart-panel-surround"); if(!RokVM.Cart.cartPanel||!RokVM.Cart.cartButton||!RokVM.Cart.cartSurround) { return RokVM.Cart } if(!RokVM.Cart.Fx) { RokVM.Cart.Fx=(new(Fx.Slide)(RokVM.Cart.cartPanel, { duration:400,transition:Fx.Transitions.Expo.easeOut } )).hide() } RokVM.Cart.cartSurround.setStyle("visibility","visible"); RokVM.Cart.cartButton.getFirst("a").addEvent("click",function(e) { (new Event(e)).stop(); if(!RokVM.Cart.cartPanel.getText().length&&!window.webkit) { return } if(!RokVM.Cart.cartPanel.innerHTML.clean().length&&window.webkit) { return } var a=RokVM.Cart.cartButton.getElement("strong"); if(!a||!a.getText().toInt()&&(!RokVM.Cart.cartPanel.getText().length&&!window.webkit)) { return } RokVM.Cart.clicked=true; if(window.fontFx&&window.fontFx.open) { window.fontFx.toggle() } if(window.loginFx&&window.loginFx.open) { window.loginFx.toggle() } RokVM.Cart.Fx.toggle() } ); RokVM.scrollWindow=new(Fx.Scroll)(window); RokVM.Cart.getShortList(); RokVM.Cart.XHRify() } ,XHRify:function() { var b=$$(".addtocart_form"); if(!b.length) { return RokVM.Cart } b.each(function(a) { a.addEvent("submit",RokVM.Cart.add.bindWithEvent(a,true)) } ) } ,add:function(e,c) { (new Event(e)).stop(); (new Ajax(this.getProperty("action"), { data:$(this),evalScripts:true,onComplete:function(r) { var a=new Element('div').setHTML(r); var b=a.getElement('.shop_tip'); RokVM.Cart.getShortList((r.length&&b)?r:false); RokVM.Cart.clicked=c||false } } )).request() } ,getShortList:function(b) { var c= { onComplete:function(a) { RokVM.Cart.update(a,b) } ,evalScripts:true,data: { only_page:1,page:"shop.basket_short",option:"com_virtuemart" } }; (new Ajax(RokVM.Base.uri+"index2.php",c)).request() } ,handleError:function(a) { var b=RokVM.Cart.cartPanel; var c=new Element('div').setHTML(a); var d=b.getElement('.show-cart-button'); var e=c.getElement('.shop_tip').inject((d)?d:b,(d)?'before':'inside') } ,update:function(a,b) { RokVM.Cart.cartPanel.setHTML(a); var c=RokVM.Cart.cartPanel.getElement(".total_products"),total=0; if(c) { total=c.innerHTML.split(" ")[0].toInt() } if(!total) { RokVM.Cart.cartButton.getFirst().setProperty("class","cart-button-desc") } else { RokVM.Cart.cartButton.getFirst().setProperty("class","cart-button-desc-full") } RokVM.Cart.cartButton.getElement("strong").setText(total); if(b)RokVM.Cart.handleError(b); if(RokVM.Cart.clicked&&a.length||b) { if(window.fontFx&&window.fontFx.open) { window.fontFx.toggle() } if(window.loginFx&&window.loginFx.open) { window.loginFx.toggle() } RokVM.scrollWindow.toTop(); RokVM.Cart.show(); RokVM.Cart.hide.delay(RokVM.autoHide*1000) } RokVM.Cart.clicked=false } ,show:function() { RokVM.Cart.Fx.slideIn() } ,hide:function() { RokVM.Cart.Fx.slideOut() } }; window.addEvent("domready",RokVM.Base.start); window.addEvent(window.webkit?"load":"domready",function() { RokVM.Base.featuredHeight("home-featured") } ); var live_site = RokVM.Base.uri; Then following - this in the same theme.js file (this is not packed) Code: /// Following is VM stuff, kept for compatibility /** * This file holds javscript functions that are used by the templates in the Theme * */ // AJAX FUNCTIONS function loadNewPage( el, url ) { var theEl = $(el); var callback = { success : function(responseText) { theEl.innerHTML = responseText; if( Lightbox ) Lightbox.init(); } } var opt = { // Use POST method: 'get', // Handle successful response onComplete: callback.success } new Ajax( url + '&only_page=1', opt ).request(); } function handleGoToCart() { document.location = live_site + '/index.php?option=com_virtuemart&page=shop.cart&product_id=' + formCartAdd.product_id.value ; } function handleAddToCart( formId, parameters ) { formCartAdd = document.getElementById( formId ); var callback = function(responseText) { updateMiniCarts(); // close an existing mooPrompt box first, before attempting to create a new one (thanks wellsie!) /*if (document.boxB) { document.boxB.close(); clearTimeout(timeoutID); } document.boxB = new MooPrompt(notice_lbl, responseText, { buttons: 2, width:400, height:150, overlay: false, button1: ok_lbl, button2: cart_title, onButton2: handleGoToCart }); setTimeout( 'document.boxB.close()', 3000 );*/ } var opt = { // Use POST method: 'post', // Send this lovely data data: $(formId), // Handle successful response onComplete: callback, evalScripts: true } new Ajax(formCartAdd.action, opt).request(); } /** * This function searches for all elements with the class name "vmCartModule" and * updates them with the contents of the page "shop.basket_short" after a cart modification event */ function updateMiniCarts() { var callbackCart = function(responseText) { carts = $$( '.vmCartModule' ); if( carts ) { try { for (var i=0; i<carts.length; i++){ carts[i].innerHTML = responseText; try { color = carts[i].getStyle( 'color' ); bgcolor = carts[i].getStyle( 'background-color' ); if( bgcolor == 'transparent' ) { // If the current element has no background color, it is transparent. // We can't make a highlight without knowing about the real background color, // so let's loop up to the next parent that has a BG Color parent = carts[i].getParent(); while( parent && bgcolor == 'transparent' ) { bgcolor = parent.getStyle( 'background-color' ); parent = parent.getParent(); } } var fxc = new Fx.Style(carts[i], 'color', {duration: 1000}); var fxbgc = new Fx.Style(carts[i], 'background-color', {duration: 1000}); fxc.start( '#222', color ); fxbgc.start( '#fff68f', bgcolor ); if( parent ) { setTimeout( "carts[" + i + "].setStyle( 'background-color', 'transparent' )", 1000 ); } } catch(e) {} } } catch(e) {} } } var option = { method: 'post', onComplete: callbackCart, data: { only_page:1,page: "shop.basket_short", option: "com_virtuemart" } } new Ajax( live_site + '/index2.php', option).request(); } /** * This function allows you to present contents of a URL in a really nice stylish dhtml Window * It uses the WindowJS, so make sure you have called * vmCommonHTML::loadWindowsJS(); * before */ function fancyPop( url, parameters ) { parameters = parameters || {}; popTitle = parameters.title || ''; popWidth = parameters.width || 700; popHeight = parameters.height || 600; popModal = parameters.modal || false; window_id = new Window('window_id', {className: "mac_os_x", title: popTitle, showEffect: Element.show, hideEffect: Element.hide, width: popWidth, height: popHeight}); window_id.setAjaxContent( url, {evalScripts:true}, true, popModal ); window_id.setCookie('window_size'); window_id.setDestroyOnClose(); } I have a map with hotspots, and when you hover over a hot spot, a hidden DIV appears. Thanks to my favorite coding forum, this one, I was able to successfully accomplish this first bit of code. The only problem I'm having now is getting the DIV to remain open while I move my mouse from the hotspot to the DIV. As soon as I move my mouse away from the hotspot, the DIV disappears. I need to put links in the DIVs, and users will need to be able to move their mouse away from the hotspot to click on the link, but currently can't. I experimented with setTimeout, but didn't get too far. If anyone could help me, I'd appreciate it. I really need to get this working. Code: <img src="images/map.png" alt="" usemap="#map"/> <map id="map" name="map"> <area shape="rect" coords="211,84,225,97" href="#" alt=""/> <area shape="rect" coords="226,78,240,92" href="#" alt=""/> <area shape="rect" coords="353,66,376,89" href="#" alt=""/> </map> <div id="hidden"> <div class="location" style="left:25px; top:-290px;"> <img src="images/location01.jpg" alt=""/> </div> <div class="location" style="left:25px; top:-275px;"> <img src="images/location02.jpg" alt=""/> </div> <div class="location" style="left:275px; top:-285px;"> <img src="images/location03.jpg" alt=""/> </div> </div> <!-- #hidden --> Code: function show(which) { var area = document.getElementById("map").getElementsByTagName("area"); var locations = document.getElementById("hidden").getElementsByTagName("div"); for (var a=0; a < area.length; ++a) { if(area[a] == which) locations[a].style.display="block"; } } function hide() { var locations = document.getElementById("hidden").getElementsByTagName("div"); for (var d=0; d < locations.length; ++d) { locations[d].style.display="none"; } } function init() { var area = document.getElementById("map").getElementsByTagName("area"); for (var a=0; a < area.length; ++a) { area[a].onmouseover = function() { show(this); } area[a].onmouseout = hide; } } window.onload = init; Hi, my website name is marutiindia.in. I am using lof k2 scroller module along with image magnifier plugin developed by Vtem. The problem is I get JS error in scroller module JS file when I try to enable both these extensions at the same time. If I disable image magnifier plugin there is no error. I don't know what are these errors but I get the following error: Code: Uncaught TypeError: Object #<Object> has no method 'getElement' Class.initialize script_12.js:27 (anonymous function) mootools-more.js:29 i.extend.$owner mootools-core.js:136 (anonymous function) mootools-core.js:131 (anonymous function) Please help me. Thanks. Hi all, I am looking for this javascript, script that when I click a specific link 1. Opens a new window 2. Specifies a specitic window title 3. Load an image on it (there will be no text but only an image shown) Could you please help me understand how I do that? Regards Alex Hello How to Make a Html Form Shows Up when Visitor Click a Link .. I have seen Site where you want to add Message u click Link then the Form under the Link Shows Up .. it stays Hidden unless Visitor Click Link 'Send Message' . It seems done by Java but How .. Hi I wrote following code for the purpose to single right click to open new window, while left click would open another window. It works for IE but does not work for Firefox. Please help. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US|zh-Hans|zh-Hant"> <head> <title>Javascript Question</title> <META NAME="LANGUAGE" CONTENT="en"> <META NAME="DOCUMENTCOUNTRYCODE" CONTENT="us"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=GB18030"> <script language='Javascript' type='text/javascript'> var rightClick = false; window.document.oncontextmenu = new Function("return false"); window.document.onmouseup = mouseUp; function mouseUp(e) { if (!e) var e = window.event; if (e.which) rightClick = (e.which == 3) else if (e.button) rightClick = (e.button == 2); if (rightClick) window.open('http://www.yahoo.com/'); } </script> </head> <body> <a href="#" onclick="window.open('http://www.google.com/')" onmouseup>Open New Window</a> </body> </html> Ok, first let me explain what I try to do. I have a menu with some items containing a submenu. The submenu's should open when a parent is clicked and contains submenu's, and when traveling to another page (from the item clicked, for example a parent of submenu item), the submenu should remain active and visible. When I click on a parent (at the moment the hrefs contain no links just #), the submenu opens. But when I click another main item, the submenu of the previous parent remain visible, and the submenu of the parent just clicked is also visible, while I only want the submenu of the parent clicked to be visible or when parent with no submenu the submenu should be invisible. So, here is the code I have so far: Code: <div id="topnav"> <ul> <li> <a href="index.html">Home</a> </li> <li> <a href="#">Over Meves</a> <ul class="submenu"> <li><a href="#" class="suba">Historie</a></li> <li><a href="#" class="suba">Onze mensen</a></li> <li><a href="#" class="suba">Werkzijze</a></li> </ul> </li> <li> <a href="vervolg3.html">Disciplines</a> <ul class="submenu"> <li><a href="vervolg.html" class="suba">Klimaatbeheersing</a></li> <li><a href="#" class="suba">Elektrotechniek</a></li> <li><a href="#" class="suba">Sanitaire techniek</a></li> <li><a href="#" class="suba">Energiebesparingstechniek</a></li> <li><a href="#" class="suba">Bouwfysica en geluid</a></li> <li><a href="#" class="suba">Diensten energiebesparing</a></li> </ul> </li> <li> <a href="#">Expertise</a> <ul class="submenu"> <li><a href="#" class="suba">Woningbouw & Utiliteit</a></li> <li><a href="#" class="suba">Zorg & Welzijn</a></li> <li><a href="#" class="suba">Milieu & Energie</a></li> <li><a href="#" class="suba">Beheer & Onderhoud</a></li> <li><a href="#" class="suba">EPA & EPC</a></li> <li><a href="#" class="suba">Legionella beheersing</a></li> </ul> </li> <li> <a href="#">Contact</a> <ul class="submenu"> <li><a href="#" class="suba">Adres & route</a></li> <li><a href="#" class="suba">Werken bij</a></li> </ul> </li> </ul> </div> The javascript: Code: <script type="text/javascript"> var ddmenuitem = 0; function jsddm_open() { jsddm_close(); ddmenuitem = $(this).find('ul.submenu').css('display', 'block'); } function jsddm_close() { if(ddmenuitem) ddmenuitem.css('display', 'none'); } $(document).ready(function() { $('#topnav > ul > li').bind('click', jsddm_open) $('#topnav ul li a.suba').click(function(e){ if ($(this).attr('class') != 'active'){ $('#topnav ul li a.suba').removeClass('active'); $(this).addClass('active'); } }); $("ul.submenu > li > a").each(function () { var currentURL = document.location.href; var thisURL = $(this).attr("href"); if (currentURL.indexOf(thisURL) != -1) { $(this).parents("ul.submenu").css('display', 'block'); } }); $('a').each(function () { var currentURL = document.location.href; var thisURL = $(this).attr('href'); if (currentURL = thisURL) { $(this).parents('ul.submenu').css('display', 'block'); } // else { // $(this).parents('ul.submenu').css('display', 'none'); // } }); }); </script> And the css: Code: #topnav ul { list-style: none; padding: 0; margin: 0; } #topnav ul li { float: left; margin: 0; padding: 0; } #topnav ul li a { padding: 5px 15px; color: #00537F; text-decoration: none; display: block; font-weight: bold; } #topnav ul li a:link { color: #FFF; text-decoration: none; } #topnav ul li a:visited { color: #FFF; text-decoration: none; } #topnav ul li a:hover { color: #FFF; text-decoration: underline; } #topnav ul li a.active { text-decoration: underline; color: #FFF; } /*#topnav ul li:hover .submenu { display:block; }*/ #topnav ul li ul.submenu { float: left; padding: 4px 0; position: absolute; left: 0; top: 24px; display: none; background: #e0e0e0; color: #00537F; } #topnav ul li ul.submenu a { display: inline; color: #00537F; padding: 4px 8px; } #topnav ul li ul.submenu li { border-right-width: 1px; border-right-style: solid; border-right-color: #00537F; } #topnav ul li ul.submenu li:last-child { border-right-style: none; } #topnav ul li ul.submenu a:link { color: #00537F; } #topnav ul li ul.submenu a:visited { color: #00537F; } #topnav ul li ul.submenu a:hover { text-decoration: underline; color: #00537F; } #topnav ul li ul.submenu li.active { text-decoration: underline; color: #00537F; } #topnav ul li ul.submenu a.active { text-decoration: underline; color: #00537F; } Hope I explained it clear. Thanks for any help. Hey All, I replied in another thread asking about this, but I figured it would be best to have a separate thread for it. I'm trying to use lightbox (Video Lightbox) to not just open a video when clicking on a thumbnail image, but a mock "page" of several videos, where the main video plays, but there are surrounding thumbnail images that can then also be selected to play in the main player. Has anyone ever done anything like this? I've seen it done elsewhere, but wasn't sure how to actually implement it. Any suggestions would be appreciated. Thanks. Hello Everbody, I have been at this problem for 10 hours now and am going NUTS!! I am making website to look around an ancient Egyptian Tomb. Feel free to have a look: http://www.campbelltest.co.uk/britishMuseum/online/ I have a flash movie which I have scripted to utilise the browser back button using this script http://www.asual.com/swfaddress/docs/. This works fine until open a lightbox image form within the flash movie using Lokesh Dhakar Light box http://www.lokeshdhakar.com/projects/lightbox2/ and the browsers back button stops working!! The code below is to the JavScript links and the code that lauches the lightbox: Code: <script type="text/javascript" src="js/swfaddress-optimizer.js"></script> <script type="text/javascript" src="js/swfobject.js"></script> <script type="text/javascript" src="js/swfaddress.js"></script> <script type="text/javascript" src="js/swfmacmousewheel.js"></script> <script src="js/prototype.js" type="text/javascript"></script> <script src="js/scriptaculous.js?load=effects" type="text/javascript"></script> <script src="js/lightbox.js" type="text/javascript"></script> <!-- start | JC --> <!-- added for flash --> <!-- added for launch from flash --> <script language="JavaScript"> function openLightbox(url,group){ var objLink = document.createElement('a'); objLink.setAttribute('href',url); objLink.setAttribute('rel','lightbox['+group+']'); objLink.setAttribute('title','caption'); Lightbox.prototype.start(objLink); } </script> <!-- end | JC --> This code is how I have embeded the flash in the page: Code: <script type="text/javascript"> var so = new SWFObject('container04.swf', 'container04', '760', '450', '8', '#ffffff'); so.useExpressInstall('js/expressinstall.swf'); so.addParam('menu', 'false'); //so.addParam('movie','container04'); so.write('flashcontent'); var macmousewheel = new SWFMacMouseWheel( so ); </script> I have added a text box to movie that shows the back button function exicuting and what its exicuting. I have never done any work with JavaScript before so I am up the creek without a paddle!! Hi I have created the following effects on the images seen here http://techavid.com/design/test3.html . You see when you hover and then click on each image, they go from grey to color. When you click on one - the others go grey and the one clicked remains color. That's cool, but now I need the text 1st: Sun for example to display and hide along with its graphic button. The word "Sun," is a link that needs to link out to a URL so it has to be separated from the image effect code. Here code I have now.... Code: <style type="text/css" media="screen"> #wrapper { background: url('_assets/images/sun-inactive.p') no-repeat #777eee; width: 470px; margin: 0 auto; } a#sun{ background: url('_assets/images/sun-inactive.png') no-repeat; width: 107px; height: 78px; display:block; padding: 20px 10px; float: left; } a#sun:hover, a#sun.active { background: url('_assets/images/sun.png') no-repeat; width: 107px; height: 78px; display:block; padding: 20px 10px; } a#plane { background: url('_assets/images/plane-inactive.png') no-repeat; width: 107px; height: 78px; display:block; padding: 20px 10px; float: left; } a#plane:hover, a#plane.active { background: url('_assets/images/plane.png') no-repeat; width: 107px; height: 78px; display:block; padding: 20px 10px; } a#nano { background: url('_assets/images/nano-inactive.png') no-repeat; width: 107px; height: 78px; display:block; padding: 20px 10px; float: left; } a#nano:hover, a#nano.active { background: url('_assets/images/nano.png') no-repeat; width: 107px; height: 78px; display:block; padding: 20px 10px; } #popuptext { float: left; margin: -30px 0 0 0; padding: 0 0 0 0px; font-size: 11px; } #popuptext a { color: #ff6600; padding: 0 30px; } </style> </head> <body> <div id="wrapper"> <div id="navigation"> <a id="sun" href="#"></a> <a id="plane" href="#"></a> <a id="nano" href="#"></a> </div> <div style="clear:both"></div> <div id="popuptext">1st: <a href="#">Sun</a> 2nd: <a href="#">Airplane</a> 3rd: <a href="#">Nano</a> </div> </div> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" type="text/javascript"></script> <script type="text/javascript" charset="utf-8"> $(document).ready(function() { // target each link in the navigation div $('#navigation a').click(function() { // link that you clicked clicked = $(this).attr('id'); // make sure that all the others are not active // except for the clicked one $('#navigation a').each(function() { if ($(this).attr('id') == clicked) { $(this).addClass('active'); } else { $(this).removeClass('active'); } }); // prevent the default link action return false; }); }); </script> What jquery or javascript code do I need to do this? thanks, chaser i found a tutorial for doing the lightbox image viewer...and the link and demo is given below.. can someone tell me how do i replace the image with text in the lightbox....i mean when we hit on the image what shud i do to display text instead of image....hit on the image in the site and it will display an image.... http://www.dynamicdrive.com/dynamici...box2/index.htm thanx First off thank you in advance to whomever decides to help out. I am having an issue where I am using lightbox, however what is showing up is a text link "Request Email." I understand how to manipulate this text to say anything I want. However, I am having difficulty changing the text link to an image. Instead of the text, I want to have an image (button) stored on my server http://www.something.com/something.jpeg be the link to click on instead of the text. It seems this would be easy to accomplish, but I cant figure it out. It anybody can send me in the right direction it would be appreciated. Thanks! [CODE] <a id='anchor_LU8eKAvs2W' href='http://www.emailmeform.com/builder/form/LU8eKAvs2W'>Request Email!</a><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script type="text/javascript"> if (typeof jQuery == 'undefined'){ document.write(unescape("%3Cscript src='http://www.emailmeform.com/builder/js/jquery-1.4.4.min.js' type='text/javascript'%3E%3C/script%3E")); } </script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script> <script type="text/javascript"> if (typeof $.ui == 'undefined'){ document.write(unescape("%3Cscript src='http://www.emailmeform.com/builder/js/jquery-ui-1.7.2.custom.min.js' type='text/javascript'%3E%3C/script%3E")); } </script> <link rel="stylesheet" type="text/css" href="http://www.emailmeform.com/builder/styles/dynamic.php?t=post" /> <script type="text/javascript" src="http://www.emailmeform.com/builder/js/dynamic.php?t=post&t2=0&use_CDN=true"></script> <script>$(function(){$('#anchor_LU8eKAvs2W').colorbox({width:'75%', height:'75%', iframe:true});})</script> [CODE] Hey guys, I'm trying to accomplish something similar to what the develop on this site did: http://backlinkwatch.com/ When you click on the text area, a clickable image, with a 50% black opacity background overlay, and an exit either through a link or clicking outside of the box, shows up. I want to accomplish the same thing, but have the image popup show up on the page load instead of requiring a click of the text area. In addition, I would like this popup only once to each IP address; ie, if you visit a page on my site, this will show up, but if you close it and refresh the page or visit another page on the site a cookie will be stored that knows its already been opened once and it won't try to do it again. Thanks to anyone who can help me with this! I would like to add a Lightbox like image display function to TinyMCE. What is a good approach in the regard, integration or extension? Thank for your input in advance. Hello, I would like some help with a two stage display of thumbnails. I have managed to display all thumbnail product images of my targetId in a scrolling div from the contents of my targetId image folder. I have also managed to display the thumbnail as a larger image in a html image. I would now like to apply a href link to the larger image so that I can display using jsquery lightbox, but I can't figure out what code i need and where it should go. Please help! Code: <head> <script type="text/javascript"> function replaceImg(path) { var imgDest = document.getElementById('image'); var imgSrc = path; imgDest.setAttribute("src", imgSrc); } </script> </head> <body> <div class="productimage"><img id="image" img src="product_images/<?php echo $targetID; ?>/<?php echo $targetID; ?>.jpg" width="253" height="378" border="0" /></div> <div class="gallerypics"><?php $counter = 0; foreach (glob("product_images/$targetID/thumb/*.jpg") as $pathToThumb) { $filename = basename($pathToThumb); echo ('<div class="gallerypicsframe"><a href="javascript:replaceImg(\'product_images/'.$targetID.'/'.$filename.'\')"><img src="'.$pathToThumb.'"" width="60" height="90" border="0"/></a></div>'); $counter++; } ?> </body> Hi, I am still designing the website and want some flexibility. I am capturing the mouse clicks fine on top of an image, but the coordinates are absolute and not relative to the image. How can I capture mouse clicks relative to the image so that I can move the image anywhere in my website? Thanks! Is there a way when you use the window.open to not display the Internet Explorer pop up box that say the file can not be found when the file does not exist? Below is a small example of the code. I want to supress the message when new.pdf does not exist and go directly to opening the old copy of the file. Or is there a way to check to see if a file exists before trying to open it? <script language="JavaScript"> window.onerror=function(){ return true } function LoadPDF() { try { window.open('FILE:new.pdf') } catch (err) { window.open('FILE:Old.pdf') } } </SCRIPT> I am trying to open a link in a new window and get this error. What am i doing wrong on the code below: Code: <a onclick="window.open('http://c1739202.cdn.cloudfiles.rackspacecloud.com/Assignments_final_demo.htm' width=" height='860,menubar=no,status=no,"' location="no,toolbar=no,scrollbars=no')"" c1739202.cdn.cloudfiles.rackspacecloud.com window.open(?http: 1155, Assignments_final_demo.htm?,?> <img alt="" hspace="0" src="/files/images/PUdropBoxDemoButton.jpg" align="default" border="0" /></a></div> What is the correct code to make a sound play every time you click a certain image? All the codes I've found online aren't working, or I'm not inputting something correctly..
I have about 40 images on an educational website. When the user clicks each image, a different one second long mp3 should play without opening a new window. Is it possible to do this with javascript? Thanks in advance. |