jquery

jQuery and Prototype events

I have a Prototype code that is triggered upon 'load' event: Event.observe($(imageEl), 'load', this.someFunction.bind(this)); When I create 'Real' event using jQuery code like jQuery(...imageEl selector...).attr("src", filename); it fires the Prototype code (someFunction). Good! Next I try to fire the Prototype code using jQue...

How to bind an event to the group of links in AHAH-requested HTML

Hi all! I have an AHAH-requested HTML, like: <table> <tr> <td>...</td> <td><img src="..." onClick="get_next_ahah(sell####)" id="sell####"/></td> </tr> <tr> <td>...</td> <td><img src="..." onClick="get_next_ahah(sell####)" id="sell####"/></td> </tr> ... and so on where #### - numerical IDs from DB. How can I replace th...

Truncate a string of numbers to a certain length

I have the jquery code below that returns a list of ID's like this 1|2|3|4|5|6|7|8|9 and so on for every List item I have on the page, I also have a dropdown selection box named topfriendNumber. I need to take the value from topfriendNumber dropdown box and make sure my list of ID's does not exceed it. So if the dropdown is selected ...

Fix Broken Links with Jquery

Hello. This is probably a stupid question, but I'm using jquery.load() and Jquery UI's tabs.. the pages that i load in there have detail links which are relative inside them like <a href="mypage.html">link</a> So say my main page is myserver.com/rootdir/DefaultTabs.asp So if the page I am loading is in myserver.com/rootdir/dir1/page...

Access outside variable in loop from Javascript closure

See: for (var i in this.items) { var item = this.items[i]; $("#showcasenav").append("<li id=\"showcasebutton_"+item.id+"\"><img src=\"/images/showcase/icon-"+item.id+".png\" /></li>"); $("#showcasebutton_"+item.id).click(function() { alert(item.id); self.switchto(item.id); }); } The problem is that the ...

jQuery appended text is invisible

I'm trying to create a couple of buttons above a textarea to insert some HTML code -- a VERY poor-man's HTML editor. I have a couple of INPUT elements, and I'm using jQuery to set a click handler that will call's jQuery's append() or html() or text() functions. The handler fires, it shows a debug alert(), but the text I'm trying to app...

how do you select all checkboxes when user clicks a button

i have a form with a "Select All" button and a bunch of checkboxes. i want to have it select all checkboxes when the user clicks the "Select All" button. is there elegant way in jquery to do this? EDIT #2: i have isolated the problem down to this code; style="display: none;". if i remove this code it works fine. any ideas? EDIT: Th...

Check if jQuery is loaded in PHP

Is there a way to check if jQuery is loaded using PHP? I have two different plugins in Joomla that load the jQuery JS, but when it is included more than once it does not work correctly. To explain the process a bit more: Joomla offers an ability to intercept the HTML source before it is rendered, essentially working on the source code ...

What's your favourite jQuery plugin?

Post the demo here, the more the better:) ...

jquery execute function in all event

is it possible to execute a function in all events ...

Geolocation using hostip with javascript

This is probably a very silly question. I am trying to do a geolocation to find a users address based on their ip address using the api provided by http://www.hostip.info/use.html. I am using this in conjuction with jquery with the following code: $.get("http://api.hostip.info/get_html.php", function(data){ alert("Data Loaded: " + d...

How to block a panel's contents but not block the entire page

hi. i have a requirement where I have 2 panels. The first panel is having some content. The Second panel is having some content but here I need to block the Panel1. This means I want even panel1 to appear but it should be blocked like things means when user clicks on any button in panel1 N...

The jQuery treeview plugin doesn't work within a jQuery accordion plugin

I am currently using the jQuery accordion plugin, and I need to use the treeview plugin within the accordion. However this doesn't work, and it seems to be a known problem (try googling "jquery accordion treeview"). Are there any plugins that might replace treeview but provide me with a similar flexible tree-like navigation behaviour? (...

Can I set a value in the onclick function?

I have a link and on clicking the link I want to set the value of a flag variable to 1. Is that possible? Like <a id='ctr' href='#' onclick='flag=1'> Hello </a> And also how to write the function for the onclick event on the same line, like instead of <a id='ctr' href='#' onclick='call_this();'> Hello </a> function call_this(){ ...

How to fill + one year date from another textbox current text box

hi, I have two textboxes in my vb.net code <tr> <td align="right"> <b>ActivationReqDT:</b> </td> <td> <asp:TextBox ID="ActivationReqDTTextBox" runat="server" Text='<%# Bind("ActivationReqDT","{0:dd/MM/yyyy}") %>' /> </td> </tr> <tr> <td align="right"> <b>DeactivationReqDT:<...

How to make multiple Popups using Jquery

For pop up im using the following code style : a.selected { background-color:#1F75CC; color:white; z-index:100; } .messagepop { background-color:#FFFFFF; border:1px solid #999999; cursor:default; display:none; margin-top: 15px; position:absolute; text-align:left; width:394px; z-index:50; padding: 25px 25px 20...

[jQuery] newbie question

Hi all, i have following simple code for a word/tag in a tagcloud: <a about="http://localhost/d456c6" href="http://localhost/d456c6" class="tagweight0 Resource">abda</a> i want to change the background on click of a word. the problem is, that i have not only one word with class "tagweight0". Here my jQuery example code: $('tagweigh...

jQuery date picker

Dear All. I have a main html file and after the button click, it shall come from AJAX test.html Test.html: <div type="text" id="datepicker">H </div> my.js: jQuery(document).ready(function($) { jQuery.ajax({ type:'POST', url:'...

Is it possible to extract a subset of jQuery?

A website I'm using on only uses a very small amount of jQuery, in the drop-down menu (I'm using the JSDDM drop-down menu). Is it possible to either manually or automatically make a cut-down version of jQuery which only contains the needed code? ...

jquery hover tooltip

please, guide me with sample code for, displaying tooltip message on hover using jquery. ...