javascript

jQuery: press J and have it do something, press H and have it do something else

I can't get a simple answer to this: When I press the letter J, i want it to hide $('.something') and when i press the letter H, I want it to show $('.something') press the letter J $('.something').hide() press the letter H $('.something').show() ...

Why is my tooltip not remaining visible on mouseover? (jQuery)

I'm trying to get a tooltip to remain visible on mouseover. It works when you mouseover the first time. But try to mouseout, then mouseover another link and mouseover that tooltip. It will fade. Check out the code on jsFiddle. Would love to know what I'm doing wrong here. http://jsfiddle.net/6FpM8/7/ ...

Mootools and repeated js execution

How do you make javascript codes execute repeatedly? Say I have a DIV with id='box' and with innerHTML of 1. Then, say we have a link "add me up", which when you click and hold your mouse, the function will repeatedly increment the inner html by 1 until you let go of the mouse? dragging mootools into the scenario, how can i run the code...

Tracking a child window across page loads

Is it possible to track a child window if the parent page is reloaded? I currently open the window like so: var childWindow; childWindow= window.open('url...'); and when I want to reopen the same child window I do childWindow.focus(); The obvious problem is that if the parent window is refreshed then it loses track of the chi...

How can I give slide effect to image when changing source of image dynamically

Im changing image source from javascript like <img src="image1.gif" name="imagename"> //Array img[0]='image1.gif' img[1]='image2.gif' ... //onclick event changing img src document.images[imagename].src = img[1] Its working fine. How can I give it a slide effect to image when changing source of image? I can use jquery. ...

Reset dropdown lists using javascript

Hello all. I have the following scenario - a few dropdwon lists and a textbox. I'd like to 'reset' these drop downs to their original value when a user clicks on the textbox: Javascript: function ResetDropDowns() { var ddlSuppliers = document.getElementById('<%=ddlSuppliers.ClientID%>'); var ddlResponse = document.getElemen...

Google Maps: Zoom and pan inside a sub bounding box in the main viewport.

I am creating a google map with some specific requirements. The map is lets say 800x600 pixels wide. I need all the markers to show in an area of 400x600px on the left hand side of the map. The other half is covered with navigation panels (but the map must be visible in the margins behind the panels). I've been able to set the zoom lev...

Hover effects on irregular polygons in CSS

Hi, I'm wondering how to go about marking up and coding hover effects for a map similar to this image. When each district (or section) is moused over/touched/clicked I need to change the colour of it without affecting any other section. The boundaries on each section must be representative of the image and shouldn't be squares. The sol...

Cross-browser, clean solution for drop-down menus across frames?

Let me start off by saying I really like Superfish (& jQuery). Unfortunately, this - apparently? - does not offer cross-frame support out of the box. Situation: extranet website, consisting of 2 frames, divided horizontally. The top frame (the smallest one) contains a menu. When hovering over this menu, the "drop down" content gets disp...

I want on select value in one combo the other will fill on same page

Hi all I Have two combo box And I want on select value in one combo the other will fill on same page and the value come from database in both combos. any idea Thanks ...

How to override markPrevious and markNext methods on rich:suggestionBox javascript

Hi, I have a requirement where users should be able to navigate from the first to the last item in a rich:suggestionBox's list by pressing the key, and vice versa by pressing the . I need to get this working on richfaces 3.3.x The quest to get this done has led me to the javascript that is behind the rich:suggestionBox. You can find ...

Javascript frameworks used on server side to extend Javascript core?

There are a lot of frameworks for the frontend: jQuery Prototype Mootools YUI ExtJS Dojo Could these be used on the server side to extend Javascript native classes for example: object2 = object1.clone(); And is this a good way of extending Javascript? Cause I don't want to create every basic function I need but lacks from Javascr...

jQuery capitilize first letter each word

I have been using jQuery address plugin and it passes an event.value which might result in /messages/inbox/. I want to be able to turn that into Messages Inbox. I am not sure which regex to use and how to do this. Currently I have this, but this is just way too messy for me. var href = event.value != '/' ? event.value : '/wall/'; var ...

JavaScript - get array element fulfilling a condition

Hi, I'm learning JavaScript using W3C and I didn't find an answer to this question. I'm trying to make some manipulations on array elements which fulfill some condition. Is there a way to do it other than running on the array elements in for loop? Maybe something like (in other languages): foreach (object t in tArray) if (t follows...

Different Image have different dimensions

I have a image gallery, my requirement is to apply diffrent image sizes to all image my html markup is <div class="post-attacthe-img"> <ul> <li><a><img src="1.png"/></a></li> <li><a><img src="2.png"/></a></li> <li><a><img src="3.png"/></a></li> <li><a><img src="4.png"/></a></li> <li><a><img src="5.png"/></a></li> <li><a><img src="6.pn...

Call javascript function from jquery success

Hi, I'm having an issue in the success callback of my ajax function. On success of the ajax function I want to call a javascript function that is defined in an external file that is included in the header. However the javascript function never gets called. Is there something I am doing wrong here? My JQuery looks like this: $(document)...

Jqplot is working in Firefox but showing blank page in Safari and Chrome

I have used jqplot and build a graph with use of jQuery and Javascript http://server.dotsquares.com/cstik/chart.html which is working fine with Firefox but not showing anything in safari [edit Marcel K.: neither in Chrome]. please suggest me what extra code should i place to make it done. Thanks ...

zoom and rotate image , option in iframe

hi i want to know zoom plus and zoom minus and rotate the image in iframe. thanks in advance; ...

Namespaces in JSON

Is there such a thing as JSON namespaces, just like XML namespaces? Has anyone created a spec or libraries for this? Is this a good or a terrible idea? I want to make a data spec that can be represented in XML as well as JSON. However I also need the namespace concept, that the data can be extended by annotations in different vocabulari...

JavaScript - How to make an array that contains objects by reference?

Hi, I'm using JavaScript Mapping Library - OpenLayer to create a markers overlay. I want to control the markers dynamically: add new ones and remove existing markers from the layer. the way to add a new marker to the layer is by the command: markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(0,0),icon)); as you can see, t...