jquery

.show table rows is scrolling to the top on first show

When I show a table row for the first time, the page always scrolls to the top in both IE and Firefox. Subsequet shows do not do this. I have traced it to the first action that jquery takes on a show, where it appends, reads the display value, and removes an element from the body in order to populate elemdisplay[]. I think this is cau...

Can I force WebKit browsers to show the fragment identifier?

I'm using jQuery and the fragment identifier to create a state change depending on which part of a one-page site the user is currently looking at. I've finally got this to work but as both Safari and Chrome won't display the fragment identifier I can't make it into a variable and therefore the system breaks down. Is there a way to forc...

Jquery Lavalamp current menu

Hi, I implemented the Lavalamp menu in my website, and I wanted to do this: when the users click in some link in the menu, then the hover stays in that link. The lavalamp effect is working. The jquerycode I have is this: <script type="text/javascript"> $(function() { $("#menutop").lavaLamp({ fx: "backout", ...

jquery associative array made up of variables

I have the following code: var paramTemp = ret.split('^'); $.each(paramTemp, function(key, elem) { var splitTemp = elem.split('*'); params = { splitTemp[0]: splitTemp[1] }; }); I get complaints when I try to set the key to splitTemp[0]. How do I set a key to a variables value? Thanks. ...

jQuery.map() and iteration

I'm working my way through the O'Reilly jQuery Cookbook. On p.65 there is an example that looks wrong to me, but I'm new to jQuery (less than a week) so I figure it is very likely that I am the one who is confused. The code intends to get the first three items from an ordered list & do something with them; for simplicity's sake (on the ...

Click Event for SVG Rectangle

I'm using SVG together with jQuery in my Mvc Application. I draw a series of rectangles on my page and what I would like to do is attach a click or mouseover event for each rectangle, for say, popup an alert box. I've tried something like this, so far: $("rect[id='Y6']").attr('onclick', function() { alert("Hello!") }); and $("rect[id=...

jquery doesn't add my list elements to a dynamic injected <ul> list

Hey there I really don't know where the fault is all about. Here is my code: $(document).ready(function(){ $("#folderTree > li").live('click',function(){ var id = $(this).attr("id"); if($('#' + id).hasClass('folderClosed')){ $.ajax({ url: "libs/php/ajax/documents/treeHandler.php", type: "POST", ...

how to find out whether a link is handled by a javascript or uses the href url

Hi, i'm trying to debug a link, but the opened url is a bit different from the one given in the href attribute. it seems like some javascript is used to handle the link after a click event. unfortunately the js file is very huge and unreadable, so i can't find the place, that changes or handles my link. is there any possibility to deb...

jQuery iPhone Style Ajax Switch - IE Error

I'm using this jQuery Plugin - http://papermashup.com/jquery-iphone-style-ajax-switch/ And in IE 8, I recieve the following error: Message: Invalid argument. Line: 12 Char: 12949 Code: 0 URI: jquery-1.3.2.min.js Would anyone have any idea as to what the cause of this is and how to resolve it? ...

How to update DIV content in Firefox using Javascript?

Hi I have this code in javascript to show time in div and update it: if (!document.all) return var Digital=new Date() var hours=Digital.getHours() var minutes=Digital.getMinutes() var seconds=Digital.getSeconds() var dn="AM" if (hours>12){ dn="PM" hours=hours-12 } if (hours==0) hours=12 if (minutes...

json invalid according to jQuery but not jsonlint

I have a .NET web service returning the following json: {"command":"getqcardjson","valuesets":[{"datatable":"eaa65990-8f88-45e0-966b-610858ad4cb6","values":[{"Id":"eaa65990-8f88-45e0-966b-610858ad4cb6","InternalName":"Alpha Profile","TableName":"Alpha Profile","OnMainMenu":"","DefaultDataSourceId":"bb4d1622-2e48-40b6-bea7-6355d701445c",...

Jquery .trigger problem?

Hello, Simply my problem is my ajax scripts do not work if I click the link via Jquery .trigger instead of human click. If you want the whole story, please continue reading. I have used Jquery trigger function in my project. Let me explain first what does this do? I integrated Facebook login api to my project's user management system. ...

Jquery, hide & show list items after nth item

Hey Guys, Say I have an unordered list, like so: <ul> <li>One</li> <li>Two</li> <li>Three</li> <li>Four</li> <li>Five</li> </ul> How would I, using JQuery, hide the last 2 list items and have a 'show more' link there, so when clicked upon, the last 2 list items would appear? <ul> <li>One</li> <li>Two</li> <l...

What is the best way to setup a jQuery timeout interval?

According to [[ http://plugins.jquery.com/project/timeout_interval_idle ]], I should be able to say: $.interval(function() { alert('I happen every 8 seconds'); }, 8000); and have the given function run every eight seconds. However the error console says "$.interval is not a function". I have tried this under jQuery 1.4.2 and 1.4.3, b...

My append() is double appending?

$('.photoSaved').click(function () { var savedPhoto = $(this).attr('id'); // create image and append the html inside <div id=#image> $("#image").append("LOL").show(); }); Why does this turn out as "LOLLOL" ? I have looked for #image anywhere in my file. #image gets used by another function too, but that doesnt execute if y...

Colorizing a dynamically loaded file

Hi! I'm using JQuery to load a file into a textarea and CodeMirror to colorize it, but it seems that they don't play along well: I can get the file to load or the textarea (with existing text) to get colorized, using one or the other, but when I first load it and then colorize it, I end up with a blank textarea. Here is the relevant cod...

Need to display an html page triggered by a list item in the left 'div' in the center 'div'

I have a menu of list items in the left 'div' of my web page. I am currently selecting one of the list items and opening a new web page. I would like to have the content displayed in my center 'div' when the list item in the left 'div' is selected. How can I accomplish this? I have the list items in 'col2' (on the left) and I'm posti...

Jquery attaching hover to array elements

I am looking at trying to place a hover() method onto each array element. Then when the cursor rolls over the character, it is copied into another div. I am kinda lost. Do you have suggestions? <html> <head> <script type="text/javascript" scr="http://code.jquery.com/jquery.min.js"&gt; </head> <body> <script type="text/javascript"> ...

jQuery: keep toggled child element open when hovering over it

My question is similar, but different from jquery-hover-menu-when-hovering-over-child-menu-disappears. I originally had the hover event on the li.item, which was a little quirky, but did what i needed it to do. I switched the hover to the span so that the event would fire on the text block, rather than the list block, which expands the...

How to find the key code for a specific key

What's the easiest way to find the keycode for a specific key press? Are there any good online tools that just capture any key event and show the code? I want to try and find the key codes for special keys on a mobile device with a web browser, so an online tool would be great. ...