I am running a sliding menu on my website and it runs fine on my Moz FF browser but not in the IE version.This is the script I am using:(There is a couple of lines of php at the topbut main bit is javascript)
I'm trying to put together this expandable menu that runs sql (using javascript and php). I've got the code below but I'm horrible with javascript and I can't get two things to work.I cannot figure out how to use the closall() function so that when the page opens all selections are closed.I'm trying to get the mouseover colors and clickable areas and the only way I know how to do that is with a table so I thought I'd put a quick table in between the <li> but can't figure out the whole onClick= to incorporate the # so that I can get rid of the <a href> tag part...
Trying to develop drop down menu... I'm showing a div, then hiding it. It works perfectly, but I need to set a time delay... that's where the problem exists. When I add SetTimeout() to create a delay, it no longer runs correctly...
Does anyone know why these event codes run twice? E.g. I am using a cookie to keep track of [Ctrl] + [Shift] + [F] by incrementing a variable once everytime it is used. However the code for it runs twice and thus the variable is never odd as it always increments by two.It's the same for the other events, such as [Ctrl] + [Shift] + [S], it runs twice. This was not occuring when I first inserted the cookie code last week. I have read about "bubbling" but I cannot seem to stop the code running a second time.EDIT: Internet Explorer (6+) is only browser code needs to work in.
document.addEvent('keydown', function(event) { var event = new Event(event); if (event.key == 'f' && event.control && event.shift) {
I'm having difficulty in explaining why the following code runs slower in IE9 than IE8! (Testing in Win 7 IE9 both 32 bit and 64 bit running in VMWare 3 virtual machine on OS X 10.6.7)
Here's some test code that runs smoothly in about half a second in (latest) FF/Chrome/Safari on OS X, WinXP, and Win7 plus IE7 & 8 on WinXP (for simplicity I removed the tweak that makes it work in IE6).
For some reason I can't explain, it's awful in IE9, slow and clunky. Reducing the time for the setTimeout makes it a bit quicker but no less jerky.
I've tried removing and benchmarking a number of what might be the choke points (Math.min for example ... all with no change.
I have a html document, in which I include two standard libraries of functions (supposed to help me with cross browser issues), and one application-specific script file. All Javascript fcoz.
The very first attempt at invoking a function from this last script file fails miserably in IE (6) but works as it should in Moz (1.4)
I have tried putting alert()s here and there, so I (think I) can tell the exact spot where IE dies.
initAPI sits in libPlatform, and executes. I get to see the first alert. And then, boom, IE script errors on page: Object expected (points to 'regTooltip')
Am I missing something here? If my code is wrong, why is Mozilla so forgiving about it? How can I persuade IE to get the function?
Note: if I put regTooltip() right above register(), so locally in the document, it works.
I'm making a website at [URL].. and I'm trying to create a menu using Jquery 1.3.2. Anyways, if you look at the tabs in my header, they have an effect but it only works once. After I mouse over the same tab a second time, they do not animate. I also have a similar menu at [URL].. You may notice the second menu also will fade to a darker gray. If i copy and past that code into my drupal block, it will still only animate one time. Do i need to include something extra because its version 1.3.2??? I also have another Jquery plugin below the header which is called a S3SLIDER. I'm not calling the jquery script up more than once.Here's the code for the Jquery menu at adc-design.com:
I have a function which is called twice. It allows the elements of an array to be set to a different color, successively:
function ln8 (arrayA,color,current) { var arrayB=(typeof arrayA == 'string')? arrayA.split(',') : arrayA; var line = document.getElementById(arrayB[current]);
my AJAX is working in FF and Opera just fine, As in it repeats the function whenever the button is clicked, but in IE the first click works, but then it doesn't repeat...I've been searching around form some fixes, and found quite a lot but none of it seems to work [as you can see i've tried adding '.live' but still nothing]
Thought I might gives this a go instead of the usual flash. Installation went fine, but the images runs a bit inconsistently? Images are 30-50kb which shouldn't be a problem. [url]
I currently have a timer that counts down and what I would like is when the times runs out it then displays text or html (answer to question). I currenlty have the timer counting down and a seperate js show answer link that will show the div.
function update(value1){ doAjax("behind_scan.php" , "id="+value1); }function doAjax(url , str ){ xmlhttp=GetXmlHttpObject(); if (xmlhttp==null){ alert ("Browser does not support HTTP Request"); return; }url=url+"?"+str; xmlhttp.onreadystatechange=stateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); }function stateChanged(){ if (xmlhttp.readyState==4){ //document.getElementById("txtHint").innerHTML=xmlhttp.responseText; //alert(xmlhttp.responseText) document.forms.myform.scanner.value = ""; document.forms.myform.scanner.focus(); }}function GetXmlHttpObject(){ if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); }if (window.ActiveXObject){ // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; }
This pages calls a function on a separate php page to run 2 mySQL queries, the value must be put in the text 3 times in quick succession before the database is altered. I've tried all the other functions and they seem to be fine, AJAX is my weakness but I need it for the main functionality of my website. I need this to work.
question: if you want a link which simply runs a js function is it acceptable to have no href? the problem with this is the cursor doesnt change when you hover over, but if you put # as the href it jumps to the top of the screen which is sometimes unacceptable. what it the best solution to this? granted you could do event handling behind the scenes and just intercept the clicks and prevent the href from going anywhere, but sometimes you just want to stick an onclick on the anchor tag!
I'm trying to get a simple script to run where it cycles thru a few images with corresponding links and displays them on a page. I get the script to run 2 times then it breaks on the third with a runtime error saying "object expected Line 0". Code:
Problem in the timing of the script. The problem is that when I try to get an id of an object that was added by ajax, the script doesn't recognize it. The html: <select id="categories" name="categories"> <option value="3">aa</option> <option value="43">bbb</option> </select>
When I load the page, there is this script that get the value of the #categories and use ajax to fill another select and in the same ajax, I load images by another function using the new select input that was created: function fill_subcategories(){ parent=$("#categories").val(); $.ajax({ type: "post", url: "ajax/sub_galleries.php", data: 'parent='+parent, success: function(data){ $('#sub_categories').html(data); }}); show_exist_imgs() }
This fills this div: <select name="sub_categories" id="sub_categories"></select> Right after filling the #sub_categories, I use another ajax that get images of the new id of the #sub_categories, and here I get the problem.. the js: function show_exist_imgs(){ g_id=$('#sub_categories').val(); $.ajax({ type: "post", url: "ajax/show_exist_imgs.php", data: 'g_id='+g_id, success: function(data){ $('#exist_files').html(data); }}); } This script doesn't recognize the id of the new $('#sub_categories') select input.. why is that?
I have created some code that alerts me the contents of all the child divs inside a main div
function CheckEventLayout(){ //check all divs in area and resize overlapping divs var RunOnce; if( RunOnce != true ){ var StartTimes = new Array(); var EndTimes = new Array(); var i = 0; $("div#day-view-overlay").children("div.day-view-appointment").each(function(){ var DoOnce; if( DoOnce != true ){ alert($(this).html()); ..... CheckEventLayout();
The problem is this code is on a page that is loaded via post and if you go off the page and then back onto it jquery seems to attach the function again so it runs twice. So need to unbind this function before the script runs again.
I change image.style.width inside a image.onload function. And surprisingly, I found that it runs the onload function on the same image again with the new style.width value. Javascript treats this as a new image! This is the same old image.
Is there a way to pervent it from runing onload the second time?
I m trying to check if user has selected at least one checkbox and give an alert for select atleast one.the checkbox in the forms are dynamics depends up on data received from database for ex.user has to select at least one customer to process ahead .i have written below code to validate :
I have a self project I am exploring. I would like to play a simple sound file each time a function is run. The function runs every second, so, basically, I am just trying to get an audible click sound file to run every time the function runs. I do not know how to play a sound file thru javascript. Here is the code file thus far...
If this search function is included in an include file with other functions it will run more than once if you click another function first, then come back to it to do another search.
For example if I click the next page function, then decide to click for a new search it runs more than once: Next page function:
Code: $(document).ready(function() { $('a#nextpage').click(function() { var page = $(this).attr('page'); var searchval = $(this).attr('schval'); var maxpage = $(this).attr('maxpage'); $.post("findowner.php", { p1 : searchval, page : page }, function(data){ if (data.length>0){ $("#ownerIDdiv2").html(data); } }); }); }); //end
However, if I put the first search function in a separate include file all works perfect. Why it runs multiple times if it is grouped among other functions?
I've got an array of names, and one ID. I need to run an ajax call using the ID and each lastname, until I get a successful hit on the ajax call. I can't quite figure out how to determine if the function that runs the ajax call has succeeded or not, it always returns false for me... Here's the code for the loop:
I have trouble with SuperFish Menu, of course it looks very nice and is good solution, but I am not advanced in CSS language.how to change space between menu and submenu in Navi-bar type menu? Now sobmenu hide part of menu, I have to must space.....
The problem is that the height of the second level menu results in their being gaps in between each menu item so that as you move your mouse down the second menu items it quickly closes again. scripting novice fix this by telling me which variable I need to change either in the Java script or the CSS files.
I have a mega menu that when the main menu items is hovered over the mega menu the div is displayed. I want to keep the div from being shown off the right of the browser screen. I have the following that determines the amount a div is off the right of the browser:
Code: function keepMenuLeft(){ var div_width = $("li.hovering div").width();
I have installed Superfish menu module with Joomla ..Customization work more less fine ...I still have tenious problem like :
- How to have the main menu with the active color, when one of the sub-menu has been actived ?
- How to change the inactive color of the sub-menu without changing the inactive colro of the principal menu ...I did not found any information on the web ..