JavaScript - Need Assistance With Javascript Kit Jquery Megamenu
I am using the Mega Menu from http://www.javascriptkit.com/script/...megamenu.shtml and need some assistance with an adjustment.
The menu is working great as provided. However, we have a fairly wide menu layout and I have received comments that it is visually distracting to have the menu fly out horizontally. We want to have the menu start out full width and only animate to drop down vertically. Is this possible? If so, where in jkmegamenu.js would I make this adjustment? Thank you. Paul Similar TutorialsI am using the jquery megamenu from the javascriptkit.com site, for multiple buttons, and I am having an issue where one menu on the right hand side of the page wants to start the menu at the left end of the button, heading right (which is the default), and ends up forcing a 3 column menu into a 2 column one when the resolution is set to 1024 wide, because it would disappear off the page otherwise. I want instead for that one menu to END at the right hand side of the button so that the 3 columns remain intact. I do not know enough about javascript to totally follow the logic of the code and my attempts to fix this issue have produced mixed results. Any one any suggstions? [CODE] alignmenu:function($, e, megamenu_pos){ var megamenu=this.megamenus[megamenu_pos] var $anchor=megamenu.$anchorobj var $menu=megamenu.$menuobj var menuleft=($(window).width()-(megamenu.offsetx-$(document).scrollLeft())>megamenu.actualwidth)? megamenu.offsetx : megamenu.offsetx-megamenu.actualwidth+megamenu.anchorwidth //get x coord of menu //var menutop=($(window).height()-(megamenu.offsety-$(document).scrollTop()+megamenu.anchorheight)>megamenu.actualheight)? megamenu.offsety+megamenu.anchorheight : megamenu.offsety-megamenu.actualheight var menutop=megamenu.offsety+megamenu.anchorheight //get y coord of menu $menu.css({left:menuleft+"px", top:menutop+"px"}) this.$shimobj.css({width:megamenu.actualwidth+"px", height:megamenu.actualheight+"px", left:menuleft+"px", top:menutop+"px", display:"block"}) }, [CODE] Hello, I have a form that calculates a dollar amount based on the percentage entered by the user. Now the client wants the form to also calculate the percentage if the user enters a dollar amount. I am new to this so I am having trouble figuring out how to format the if statement. Here is the code that performs the calculations: Code: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $(".TextBox").hover(function(){ $(this).toggleClass('TextBoxSelected'); },function(){ $(this).toggleClass('TextBoxSelected'); }).change(function(){ calculate(); }); }); function getFldValue(fldValue) { return isNaN(fldValue) ? 0 : parseFloat(fldValue); } function calculate() { var property_SPrice = getFldValue($('#property_SPrice').val()); var price = getFldValue($('#price').val()); var REO_sale_percentage = getFldValue($('#REO_sale_percentage').val()); var REO_sale_dollars = getFldValue($('#REO_sale_dollars').val()); var REO_sale_bonus_dollars = getFldValue($('#REO_sale_bonus_dollars').val()); var REO_sale_fixed_dollars = getFldValue($('#REO_sale_fixed_dollars').val()); var REO_sale_total_dollars = getFldValue($('#REO_sale_total_dollars').val()); var REO_list_percentage = getFldValue($('#REO_list_percentage').val()); var REO_list_dollars = getFldValue($('#REO_list_dollars').val()); var REO_list_bonus_dollars = getFldValue($('#REO_list_bonus_dollars').val()); var REO_list_fixed_dollars = getFldValue($('#REO_list_fixed_dollars').val()); var REO_list_total_dollars = getFldValue($('#REO_list_total_dollars').val()); var gr_comm_percentage = getFldValue($('#gr_comm_percentage').val()); var gr_comm_dollars = getFldValue($('#gr_comm_dollars').val()); var gr_bonus_dollars = getFldValue($('#gr_bonus_dollars').val()); var gr_fixed_dollars = getFldValue($('#gr_fixed_dollars').val()); var gr_total_dollars = getFldValue($('#gr_total_dollars').val()); $('#price').val(property_SPrice); $('#gr_comm_percentage').val(REO_list_percentage + REO_sale_percentage); $('#gr_comm_dollars').val(getFldValue(REO_list_dollars + REO_sale_dollars)); $('#REO_list_dollars').val(getFldValue(REO_list_percentage/100*price)); $('#REO_sale_dollars').val(getFldValue(REO_sale_percentage/100*price)); $('#gr_fixed_dollars').val(getFldValue(REO_list_fixed_dollars + REO_sale_fixed_dollars)); $('#gr_bonus_dollars').val(getFldValue(REO_list_bonus_dollars + REO_sale_bonus_dollars)); $('#gr_total_dollars').val(getFldValue(REO_sale_total_dollars + REO_list_total_dollars)); $('#REO_sale_total_dollars').val(getFldValue(REO_sale_dollars + REO_sale_fixed_dollars + REO_sale_bonus_dollars)); $('#REO_list_total_dollars').val(getFldValue(REO_list_dollars + REO_list_fixed_dollars + REO_list_bonus_dollars)); } </script> I now need to add: Code: $('#REO_list_percentage').val(getFldValue(REO_list_dollars/price*100)); $('#REO_sale_percentage').val(getFldValue(REO_sale_dollars/price*100)); So that if the user enters a dollar amount, the form can calculate the percentage along with all of the other calculations above. How would I write that? Thanks. I have the following regex pattern: var patt=/(&(?=(amp|apos|gt|lt|quot)|[^&])+/; It's validation to ensure that any ampersand sign is followed by amp;, apos;, gt;, lt;, or qout;. It should validate any other character except the aforementioned ampersand case. The regex checks out ok on all online regex testers. however, when i apply it to javascript via the test() method, things that return a fail in the testers return true with the js test() method, so the validation isn't working for me right now in javascript. e.g. var testStr = 'someString&'; //should fail var testStr2 = 'someString&'; //should pass however, calling patt.test(testStr); returns true when it should be returning false... Thanks for any input and help you all have to offer. I've been beating this to death for about 3 hours and I'm a little stuck on it.. Hi, I am constructing a website with a page that holds a world clock. The clock displays in the centre of the page and is surrounded by 12 buttons (Individual World Cities). OnClick of these buttons changes the time displayed. I am trying to amend the code so that when one of these buttons is clicked. It not only updates and changes the clock. But also adds text below the clock that says something like "The time in New York is now displayed). I have been trying to find the code to do this for a few hours and the closest I could find was an addtext function. No matter what I do though I just cant get it to work! If anyone could help that would be appreciated. I have pasted the Script for the clock below (This code is before I edited it with the addText code). <script> var GMToffset = 0,t; function start() { GMToffset=zxcReadCookie('time')||0; t=setInterval('digitalclock()',500); } function digitalclock() { var today=new Date(); var hours=(today.getHours() + GMToffset*1+24)%24; var minutes=today.getMinutes(); var seconds=today.getSeconds(); minutes=checkTime(minutes); seconds=checkTime(seconds); hours=checkTime(hours); document.getElementById('txt').innerHTML=hours+":"+minutes+":"+seconds; } function checkTime(i) { if (i<10) { i="0" + i; } return i; } function updatetime(nu) { GMToffset = nu; zxcCreateCookie('time',nu,1); // change 1 to the number of days persistance required } function zxcCreateCookie(nme,v,days){ document.cookie=nme+'='+v+';expires='+(new Date(new Date().getTime()+days*86400000).toGMTString())+';path=/'; } function zxcReadCookie(nme){ nme+='='; var split = document.cookie.split(';'); for(var z0=0;z0<split.length;z0++){ var s=split[z0]; while (s.charAt(0)==' ') s=s.substring(1,s.length); if (s.indexOf(nme)==0) return s.substring(nme.length,s.length); } return null; } </script> </head> <body onload="start()"> <div align="center"> <input type="button" onclick="updatetime(-4)" value="Time in Buenos Aires" style="color: #07c; font-family: Arial; font-size: 12px; height: 20px; width: 250px;" /> <input type="button" onclick="updatetime(-5)" value="Time in New York" style="color: #07c; font-family: Arial; font-size: 12px; height: 20px; width: 250px;" /> <input type="button" onclick="updatetime(-8)" value="Time in San Francisco" style="color: #07c; font-family: Arial; font-size: 12px; height: 20px; width: 250px;" /><br> <input type="button" onclick="updatetime(-11)" value="Time in Hawaii" style="color: #07c; font-family: Arial; font-size: 12px; height: 20px; width: 250px;" /> <input type="button" onclick="updatetime(-13)" value="Time in Fiji" style="color: #07c; font-family: Arial; font-size: 12px; height: 20px; width: 250px;" /> <input type="button" onclick="updatetime(-14)" value="Time in Sydney" style="color: #07c; font-family: Arial; font-size: 12px; height: 20px; width: 250px;" /><br><br> <div id="txt"></div> </div> <div align="center"> <input type="button" onclick="updatetime(8)" value="Time in Tokyo" style="color: #07c; font-family: Arial; font-size: 12px; height: 20px; width: 250px;" /> <input type="button" onclick="updatetime(7)" value="Time in Hong Kong" style="color: #07c; font-family: Arial; font-size: 12px; height: 20px; width: 250px;" /> <input type="button" onclick="updatetime(6)" value="Time in Bangkok" style="color: #07c; font-family: Arial; font-size: 12px; height: 20px; width: 250px;" /><br> <input type="button" onclick="updatetime(1)" value="Time in Rome" style="color: #07c; font-family: Arial; font-size: 12px; height: 20px; width: 250px;" /> <input type="button" onclick="updatetime(0)" value="Time in London" style="color: #07c; font-family: Arial; font-size: 12px; height: 20px; width: 250px;" /> <input type="button" onclick="updatetime(3)" value="Time in Moscow" style="color: #07c; font-family: Arial; font-size: 12px; height: 20px; width: 250px;" /> </head> I have a javascript code, which initiates via "onClick" when a user clicks on a checkbox. I downloaded the sample code, but the problem is is that I need the javascript to be initiated automatically, not when a user clicks on a checkbox. I would greatly appreciate it if anyone could help me resolve this issue. Below is a sample of the code I'm using. Thanks in advance. Code: <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- iPad/iPhone specific css below, add after your main css > <link rel="stylesheet" media="only screen and (max-device-width: 1024px)" href="ipad.css" type="text/css" /> <link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="iphone.css" type="text/css" /> --> <!-- If you application is targeting iOS BEFORE 4.0 you MUST put json2.js from http://www.JSON.org/json2.js into your www directory and include it here --> <script type="text/javascript" charset="utf-8" src="phonegap.0.9.6.min.js"></script> <script type="text/javascript" charset="utf-8" src="SAiOSAdPlugin.js"></script> <script type="text/javascript" charset="utf-8"> // If you want to prevent dragging, uncomment this section /* function preventBehavior(e) { e.preventDefault(); }; document.addEventListener("touchmove", preventBehavior, false); */ var gLastAdLoadedDate = null; var gTotalAdsLoaded = 0; var gTimerId = null; function onBodyLoad() { document.addEventListener("deviceready", onDeviceReady,false); } function onOrientationChange() { //alert(window.orientation); } /* When this function is called, PhoneGap has been initialized and is ready to roll */ function onDeviceReady() { // listen for orientation changes window.addEventListener("orientationchange", window.plugins.iAdPlugin.orientationChanged, false); // listen for the "iAdBannerViewDidLoadAdEvent" that is sent by the iAdPlugin document.addEventListener("iAdBannerViewDidLoadAdEvent", iAdBannerViewDidLoadAdEventHandler, false); // listen for the "iAdBannerViewDidFailToReceiveAdWithErrorEvent" that is sent by the iAdPlugin document.addEventListener("iAdBannerViewDidFailToReceiveAdWithErrorEvent", iAdBannerViewDidFailToReceiveAdWithErrorEventHandler, false); var adAtBottom = false; setTimeout(function() { window.plugins.iAdPlugin.prepare(adAtBottom); // by default, ad is at Top }, 1000); } function iAdBannerViewDidFailToReceiveAdWithErrorEventHandler(evt) { alert(evt.error); window.plugins.iAdPlugin.showAd(false); var elem = document.getElementById("showAd"); elem.checked = false; } function iAdBannerViewDidLoadAdEventHandler(evt) { // if we got this event, a new ad is loaded var elem = document.getElementById("lastAdLoaded"); gLastAdLoadedDate = new Date(); elem.innerHTML = gLastAdLoadedDate.toLocaleString(); elem = document.getElementById("showAd"); elem.disabled = false; elem.checked = true; window.plugins.iAdPlugin.showAd(true); gTotalAdsLoaded++; elem = document.getElementById("totalAdsLoaded"); elem.innerHTML = gTotalAdsLoaded.toString(); if (gTimerId) { clearInterval(gTimerId); } gTimerId = setInterval(lastAdLoadedInterval, 1000); } function lastAdLoadedInterval() { var now = (new Date()).getTime(); var diff = now - gLastAdLoadedDate.getTime(); var elem = document.getElementById("lastAdLoaded"); var ms_in_a_year = 31449600000; /* 1000ms x 60s x 60m x 24hrs x 7d x 52w */ var ms_in_a_week = 604800000; /* 1000ms x 60s x 60m x 24hrs * 7d */ var ms_in_a_day = 86400000; /* 1000ms x 60s x 60m x 24hrs */ var ms_in_an_hour = 3600000; /* 1000ms x 60s x 60m */ var ms_in_a_minute = 60000; /* 1000ms x 60s */ var ms_in_a_second = 1000; var milliseconds = Math.floor(diff); var seconds = Math.floor(milliseconds / ms_in_a_second) % 60; var minutes = Math.floor(milliseconds / ms_in_a_minute) % 60; var hours = Math.floor(milliseconds / ms_in_an_hour) % 24; var days = Math.floor(milliseconds / ms_in_a_day) % 7; var weeks = Math.floor(milliseconds / ms_in_a_week) % 52; var years = Math.floor(milliseconds / ms_in_a_year); var caption = seconds + "s ago"; if (minutes > 0) { caption = minutes + "m " + caption; } if (hours > 0) { caption = hours + "h " + caption; } if (days > 0) { caption = days + "d " + caption; } if (weeks > 0) { caption = weeks + "w " + caption; } if (years > 0) { caption = years + "yr " + caption; } elem.innerHTML = caption; } function showAdClicked(evt) { window.plugins.iAdPlugin.showAd(evt.checked); } </script> </head> <body style="margin:0; padding:0;border:1px solid blue;" onload="onBodyLoad()"> <span style="position:absolute; top:0;"> This is some text at the top of the webview. </span> <br /><br /> <form> <input type="checkbox" id="showAd" name="showAd" disabled="disabled" onclick="showAdClicked(this);">Show iAd</input><br /> <br /> <span>New Ad Loaded: <span id="lastAdLoaded">Waiting.</span></span><br /> <span>Total Ads Loaded: <span id="totalAdsLoaded">None.</span></span> </form> <br /> <span style="position:absolute;bottom:0"> This is some text at the bottom of the webview. </span> </body> </html> The javascript (SoiOSADPLUGIN.JS) that is referenceD in this html page i also pasted below he Code: /** * Constructor */ function SAiOSAdPlugin() { } /** * show - true to show the ad, false to hide the ad */ SAiOSAdPlugin.prototype.orientationChanged = function() { PhoneGap.exec("SAiOSAdPlugin.orientationChanged", window.orientation); } /** * show - true to show the ad, false to hide the ad */ SAiOSAdPlugin.prototype.showAd = function(show) { PhoneGap.exec("SAiOSAdPlugin.showAd", show); } /** * atBottom - true to put the ad at the bottom, false to put the ad at the top */ SAiOSAdPlugin.prototype.prepare = function(atBottom) { if (!atBottom) { atBottom = false; } PhoneGap.exec("SAiOSAdPlugin.prepare", atBottom); } /** * Install function */ SAiOSAdPlugin.install = function() { if ( !window.plugins ) window.plugins = {}; if ( !window.plugins.iAdPlugin ) window.plugins.iAdPlugin = new SAiOSAdPlugin(); } /** * Add to PhoneGap constructor */ PhoneGap.addConstructor(SAiOSAdPlugin.install); I get the code to work when I click the checkbox, and it satisfies my needs, but having a checkbox toggle is not exactly ideal for this function. Is there anyway for me to have the "Onclick" function in this code changed to onload? I have a code written in jquery which I have to transform to javascript. is there any tool for this or I have to do this manually? Please help.. Hi, I have done a script in Jquery that resolved my problem in Firefox and Chrome but not in IE. Thought of going back to Javascript. Could you please update me the equivalent for this Jquery stuff. <script type="text/javascript"> jQuery(document).ready(function(){ var backSize = (${not empty param.backSize ? param.backSize : 0} + 1); $("#goBackResults").attr("href", "javascript:history.go(-" + backSize + ");"); var existingValue = 'backSize=' + (backSize-1); $("#when-did-i-buy .pageNum a").each(function(){ if ($(this).attr('href')) { var newValue = 'backSize=' + backSize; if ($(this).attr('href').search('backSize=')!=-1) { var t=$(this); t.attr('href', t.attr('href').replace(existingValue,newValue)); } else { $(this).attr('href', $(this).attr('href') + "&tabId=1&backSize=" + backSize); }} }); }); </script> Thanks, Ravi.P Hi, Can anyone help me on converting this code to jquery: Code: <html> <head> <script type="text/javascript" src="jquery-1.6.1.min.js"></script> <script type="text/javascript"> function showonlyone(thechosenone) { var noticecontent = document.getElementsByTagName("div"); for(var x=1; x < noticecontent.length; x++) { name = noticecontent[x].getAttribute("name"); if (name == 'noticecontent') { if (noticecontent[x].id == thechosenone) { noticecontent[x].style.display = 'block'; } else { noticecontent[x].style.display = 'none'; } } } } function showall(id) { showall.ud=showall.ud||false; var i=1; while (document.getElementById(id+i)){ document.getElementById(id+i).style.display=showall.ud?'block':'none'; i++; } showall.ud=!showall.ud; } </script> </head> <body> <center> <div id="parentdiv" > <div id="expandall" onmouseup="showall('noticecontent')" >OPEN/CLOSE ALL</div> <div id="noticeheading1" class="noticeheading" name="noticeheading"; onClick="showonlyone('noticecontent1');">Heading 1</div> <div id="noticecontent1" name="noticecontent" class="noticecontent">awertysergyetwhwgertrhztrxdtykpopmift6hwe5awfwedaserhdy4hatefeshdgtrgd</div> <div id="noticeheading2" class="noticeheading" name="noticeheading"; onClick="showonlyone('noticecontent2');">Heading 2</div> <div id="noticecontent2" name="noticecontent" class="noticecontent">fh56serhgzsrxdtrjhgzsrltkjuytinubvre6io4exjhgftxtrokzet6ttawruthrthwru</div> <div id="noticeheading3" class="noticeheading" name="noticeheading"; onClick="showonlyone('noticecontent3');">Heading 3</div> <div id="noticecontent3" name="noticecontent" class="noticecontent">fdfjesrtaw5u4wgy5gw45use4syzerhgtawerfatrastaghgryseerathw5uz4de5ser5s</div> </div> </center> </body> </html> thanks Hello, posted this on dynamicdrive.com with no response, so I am trying this forum. I have been assigned to build a content locator. We cannot use a database and all content needs to load from same page. Based on my boss' design and client needs, this is what I came up with: http://contentx.com/content_locator/ I am using a Dynamic Drive script to power the dropdown and content underneath the drop down, http://contentx.com/content_locator/js/dd_cx_script.js and using a JQuery script to change the content in the window to the right. http://contentx.com/content_locator/...s_cx_script.js My questions a 1) Is there a better method to do this? (stupid question I know... of course there is!!) I would like it to be as simple as possible, no animation needed. Just need to have content from the DIV on the right side load content in the Main body div on the left (the box) 2)Is it possible to change the content on the right side when you select an option from the drop down? (say I select <option>Free Campaigns</option> I want the content to change on the right to match one of the free campagins) 3)Finally, my margins in IE 7 are all over the map, looks great in all other browsers, but in IE my TABS (colored green and blue) are about 10pixels up to high, and my belowcontent div on the left has a top margin of 12px below the dropdown... Thanks for any help, zack hi how can i make somethin like the menus A,b, bla bla one this site? http://www.kanzenanimes.net/animes JAVASCRIPT (move.js); Code: <script type="text/javascript"> $().ready(function() { $('#ex3').jqDrag('.jqDrag').jqResize('.jqResize'); }); </script> HTML: Code: <script src="includes/js/move.js"></script> <div id="ex3" class="jqDnR"> <div class="jqHandle jqDrag"></div> <br /> MY DATA <div class="jqHandle jqResize"></div> </div> Hello! I am developing my personal website! And I am trying to implement it with JS completely. which means I need the page to be one front end page. But the back-end pages would be the ones which do the work and calculations! In other words and more explaination: I would like to have one "index.php" page that contains only a nav bar which handles the mission. Once the page load it loads with the content of "home.php" (the landing page) if the "contact" tab is clicked then I would like to load the "ContactMe.php" page content. I have done this already! but the problem is: "home.php" uses alot of javascript functions and jquery plug-ins. when I load it, it looks messy that you think the JS is disabled in your machine :-\ Note: the loading has been done with those methods: .load(), $.ajax! -> same results! The conclusion: * "home.php" * "ContactMe.php" * "About.php" Is it possible to load those pages in the "index.php" and still have their JS functions function correctly and display as if they were accessed individually? The goal that I am trying to achieve is that I make my whole website for the visitor as "One Page Site"! I am challenging myself with it though! Thank you in advance for your informative posts! Please Note that I have only put the <html><head><body> tags in the index.php and removed them from the back-end pages such as home.php, contactme.php and about.php! for that sake that it works correctly! but with no hope! I'm newbie to javascript. I'm trying to print a web part in landscape orientation. I want to include CSS in java script and change the layout of the page. Here is the print code Code: function printWebPart(tagid) { if (tagid) { var html = "<HTML>\n<head>\n"+ $("HEAD").html()+ "\n</head>\n<body >\n"+ $("#"+tagid).html()+ "\n</BODY>\n</HTML>"; var printWP = window.open("","printWebPart"); printWP.document.open(); printWP.document.write(html); printWP.document.close(); printWP.print(); printWP.close(); } } </script> and here is the css class : .landScape { width: 100%; height: 100%; margin: 0% 0% 0% 0%; filter: progid:DXImageTransform.Microsoft.BasicImage(Rotation=3); } Please suggest how do i do this? Hi! I couldn't find any information about this topic in the internet and I really wonder, how come people do not discuss it anywhere? Okay, jQuery works really great and offers many interesting effects, but what if you have JavaScript disabled? I mean I've browsed through several websites powered by jQuery with JS disabled and they doesn't work or behave weird. I know there aren't much people, who disable JS, but well I do want my page to be seen by all people in the end. I managed to do it with slider on my page (however I want to use other jQuery effects), but, for example, http://www.flowplaye...ools/index.html doesn't provide any information about this. Try to disable JS and see that nothing works. I can use <noscript></noscript> tag, but I have to make two main pages. And what if I want to view it on one page? What would you do? Regards, Aleks. Hi How do I send an array created in jQuery or Javascript to PHP? (page will be redirected to PHP) I'm thinking of URL parameters right now, but wont that result to a long URL? Is there another optimized way of sending the array? Here's my script. Which doesn't work. Here's my script, this works fine... send_array_to_other_page.html Code: $(function(){ //DECLARE ARRAY var arr = new Array(); var i = 0; $('#form').submit(function(e){ e.preventDefault(); var value = $('#box').val(); var index = arr.length; var list = ''; //ADD VALUE TO ARRAY arr[index] = value; //OUTPUT VALUES IN ARRAY for (var index in arr){ list+=index+': '+arr[index]+'<br/>'; $('#arrLength').html(arr.length); } //DISPLAY ARRAY $('#display').html(list); $('#form').get(0).reset(); //RESET FORM }); $('#send').click(function(){ window.location = 'send_array_to_other_page_2.php?list='+arr; }); }); This doesn't. It outputs Array content lost. Id also like to point out the the url of this page is send_array_to_other_page_2.php. Its missing the ?list= PHP Code: <?php $arr = $_GET['list']; echo 'The contents of the array are still... <br/>'; if(isset($arr)){ print_r($arr); } else { echo 'Array content lost'; } ?> nevermind i figured it out myself
I am being told that a snippet of JQuery code in a website that I have inherited is having problems with a $() JQuery Library Implementation. It seems to keep throwing a "tagName" error. An offered solution was to recode the JQuery into traditional JavaScript using getElementById(). I'm new to JavaScript and clueless to JQuery. I'm not exactly sure how to start. How would something like this be changeable to Javascript? Code: <script type="text/javascript"> $(document).ready(function() { $(".signin").click(function(e) { e.preventDefault(); $("fieldset#signin_menu").toggle(); $(".signin").toggleClass("menu-open"); document.forms["loginForm"].elements.loginUser.focus(); }); $("fieldset#signin_menu").mouseup(function() { return false }); $(document).mouseup(function(e) { if($(e.target).parent("a.signin").length==0) { $(".signin").removeClass("menu-open"); $("fieldset#signin_menu").hide(); } }); }); </script> I'm trying to build a gallery. So far I've used jquery for the scrolling thumbnails. The problem I am having is deciding which would be the best way to load the larger version of the thumbnails into a div? Currently I am using a jquery attribute replace, but the only problem I'm having is I want to use lightbox for the large images. Some of the images have text so they need to be big if the user would like to read them. Right now lightbox is working except that it doesn't understand what image it's on when you click on the large version. I believe this is because of the attribute replace. Here is where you can view the problem: http://www.tsutsumidaphoto.com/Mihoko/akiko3.php If you click on any thumbnail after the first then click on the large version it will bring up the first image then go from there. Any suggestions, I've tried for too long on my own! Hi guys, been running into some problems with all IE browsers and my jQuery Gallery from Galleryview. Background: I am using Java to do an image search and build up some HTML including the calls to run the galleryview scripts and return this back to the page using document.write() When I use the simple structure of placing the scripts and parameters into a sample page: Code: Code: <body> <script type="text/javascript" src="http://spaceforaname.com/js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="http://spaceforaname.com/js/jquery.easing.1.3.js"></script> <script type="text/javascript" src="http://spaceforaname.com/js/jquery-galleryview-1.1/jquery.galleryview-1.1.js"></script> <script type="text/javascript" src="http://spaceforaname.com/js/jquery-galleryview-1.1/jquery.timers-1.1.2.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#photos').galleryView({ panel_width: 800, panel_height: 300, frame_width: 100, frame_height: 100 }); }); </script> It works fine. When I try and pull all the scripts out of the page and inject them back in using document.write() I get an error on IE: Code: Code: sb.append("(function(){ document.write('" + " <script type=\"text/javascript\" src=\"http://spaceforaname.com/js/jquery-1.3.2.min.js\"></script> " + " <script type=\"text/javascript\" src=\"http://spaceforaname.com/js/jquery.easing.1.3.js\"></script> " + " <script type=\"text/javascript\" src=\"http://spaceforaname.com/js/jquery-galleryview-1.1/jquery.galleryview-1.1.js\"></script> " + " <script type=\"text/javascript\" src=\"http://spaceforaname.com/js/jquery-galleryview-1.1/jquery.timers-1.1.2.js\"></script> " + " <script type=\"text/javascript\"> " + " $(document).ready(function(){ " + " $(\"#photos\").galleryView({ " + " panel_width: 800, " + " panel_height: 300, " + " frame_width: 100, " + " frame_height: 100 " + " }); " + " }); " + " </script> " +............+ "')})()"); The variable sb is a StringBuffer and is formatted and returned: Code: Code: nextPage.setValue(sb.toString()); nextPage.setEscapeHTML(false); return nextPage; This particular error in this case in IE(8) is: Object expected which I think is referring to the jQuery as the resulting images are displayed just not in Galleryview style. This is really wracking my brains and any and all help is appreciated. D. Hi guys Im try to create a menu (http://valkesh.000space.com/) that will have 2 or 3 images loaded when hovering the item. As it currently is, I would like the first 20px to show green, and the rest to show Red. For now I am only using colors because eventually I would like to use images and have the Left and Right pics set at a fixed width and the center image growing appropriately. Below is the script I am using for the entire menu. Code: <html> <head> <script type="text/javascript" src="js/jquery-1.3.1.min.js"></script> <script type="text/javascript"> //<![CDATA[ $(document).ready(function () { //Append a div with hover class to all the LI $('#navMenu li').append('<div class="left"><div class="right"></div></div>'); $('#navMenu li').hover( //Mouseover, fadeIn the hidden hover class function() { $(this).children('div').fadeIn('1000'); }, //Mouseout, fadeOut the hover class function() { $(this).children('div').fadeOut('1000'); }).click (function () { //Add selected class if user clicked on it $(this).addClass('selected'); }); }); //]]> </script> <style type="text/css"> #navMenu { margin:0; padding:0; list-style:none; font-family:arial; text-align:center; line-height:60px; } #navMenu li { background-color:Gray; float:left; width:120px; height:40px; line-height:40px; border:solid 1px black; position:relative; } #navMenu li a { z-index:20; display:block; height:40px; position:relative; color:Black; } #navMenu li .left { background-color:Green; position:absolute; width:20px; height:40px; top:0px; z-index:0; display:none; } #navMenu li .right { background-color:Red; position:absolute; width:100px; height:70px; top:0px; z-index:0; display:none; } #navMenu li.selected { background-color:Blue; } </style> </head> <body> <ul id="navMenu"> <li><a href="#">Test 1</a></li> <li><a href="#">Test 2</a></li> <li><a href="#">Test 3</a></li> </ul> </body> </html> I would appreciate any help given! Thanks |