Insert DIV on click.
I have a CSS element defined as #map_canvas { margin-left: auto; margin-right: auto; width: 600px; height: 600px; border: #00882D 3px solid; } And on a click I would like to insert it into and DIV with an ID of current text. I thought I could insert it with the following code based on a click function. $('#gMapLinks').click(function(){ $('<div id="#map_canvas">').appendTo('#currentText'); }); That does not seem to work although I don’t see any errors and it
[basic question] JQuery not working in IE
Hi, Just started to experiment with JQuery. I have some basic functions to animate something, but they only seem to work in FF, Safari, Opera... but of course not in IE 6.0. I don't know what I'm doing wrong, yet. Tried adding the DTD doctype etc... nothing changes. Can someone help? Demo right here <html> <head> <title>test</title> <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.2.min.js"></script> <script type="text/javascript">
something that doesn't really related to jQuery but i have decided to post here.
it's nothing to do with jQuery, so it doesn't required any jQuery plugin. <script> function _isInt(arg) { pat=/^\d+$/g; return pat.test(arg); } function _valid_num($arg,$min,$max,$type,$enclose) { if($min==undefined || $min==null) $min=0; if($max==undefined || $max==null) $max=9999 if($min!='' && !_isInt($min)) throw 'Invalid value, _valid_num($arg,min=0,$max=9999,$type=\'int\',$enclose=true): $min should be integer,empty string or null'; if($max!='' && !_isInt($max)) throw 'Invalid value, _valid_num($arg,min=0,$max=9999,$type=\'int\',$enclose=true):
popup box when user clicks
Guys, I'm new to jQuery and I'm trying to create a popup-box as soon as a button is clicked. I've got an example for you guys to visualize what I'm talking about. Here it is the example: HTML Example As you can see (view source) I've used two different methods to accomplish the same thing. Method 1. $(document).ready(function(){ var button = $('#actionFeature ul li.sharethis a'); var box = $('.popUpBox'); $(button).click(function() { $(box).toggle(); }); });
Slide Up/Down. How can I do this?
Hello, I have the following HTML structure: <div class="Pane"> <h2>Articles</h2> <div class="View"> Some Content </div> </div> I want to hide/show (with a slide up/down) the div View when the h2 header is clicked. And I would like to apply this to all div's in the document with CSS class "Pane". Would even be possible to change the color of the h2 when the mouse is over? How can I do this? Thank You, Miguel
Functions to optimize some redundant code
I'm using some jQuery to break up a long input form into several steps that the user navigates through using either previous/next buttons or a menu bar that has links to each of the 9 steps. The cool thing is that after a lot of trial-and-erroring and troubleshooting, it works (I'm a rookie), but there's are pieces I'm repeating the same thing 9 times, and I'd really like some help at making it smarter. It turns out that jQuery is really awesome, so I want to get good at doing it properly. Here's
Little help on some terminology ;o
OK well jquery just clicked in my head after only a day...it's extremely easy especially with examples of every function in the documentation. I'm gonna get started on some graphics after this post so I can test out the animations and stuff. ; ) Anyways, I have a question about some terminology that I'm not clear on in the documentation. Could someone clarify these terms: 1. element 2. DOM structure 3. attribute I'd appreciate it. ;o
Automated Rotating Divs - each at different speeds
Hi, I'd appreciate some assistance on some JQuery code (I'm a newbie with JQuery). What I'm trying to do is have divs with the same class name rotate. The divs overlap each other, with only one displaying at a time. Basically, I'm building an ad rotator. Here's my working code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;
Event listener does not listen after having used $.post
Hi, I've got an Event Listener $(".SFV").click(function(event) ... And I've got an submit button < ... type="submit" class="SFV"> When this button is displayed in a normal html-script, the event listener works. When I insert this button into the same script with the help of $.post("do/setFieldVal_Input.php", {table:table, whereFieldName:whereFieldName, whereVal:whereVal, setFieldName:setFieldName, idHtml:idHtml}, function(data) { //document.getElementById('test').innerHTML=data; document.getElementById(idHtml).innerHTML=data;
Can't get load() to POST data
Hello I'm a total JS/jQuery newbie, and I'm having a problem using jQuery's load() to POST data to a remote PHP script and rewrite a DIV with whatever the server sent back. Using a proxy in between, I can see that the JS script isn't sending anything, so I guess there's something wrong in the JS code I send to the browser: echo "<div id='mydiv'>"; print "Username <input type='text' id='username' value=''/><br>"; print "<input type='button' id='mybutton' value='Logon'/><p>"; echo "</div>\n"; } ?>
My simple script won't work
This simple script wont work. It's supposed to simply select an element and alert to how many are selected. I can't see why such a simple script is not working....it keeps saying 0. js code: $(document).ready(function() {alert($('p A:link').length + ' elements');}); html code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;
jQuery Accordion h3 header tag modification
Hello im dealing with a seo problem using an accordion. Not important for readers but important for search engines.... My page structure is like this 1)header 2)topnavigation 3)rightcolumn 4)leftcolumn 5)content 5)footer I have placed the jquery accordion to the left column. Now the thing is that the left column is above the content in the page html code, and the h3 tag is above the h1,h2 which are within the content , which is not good for search engines.. I would like the accordior not to have
Newbie - Drop down Tree View
Hi Folks, I have a drop down tree view much like windows file explorer drop down tree view on the left side of navigation screen. Issue: Whenever I click on on item in this list (which is hyperlinked), the whole page reloads and the treeview collapses back, thus hiding the item in that tree. How do I keep the tree from collapsing and remain expanded when that item is clicked, which loads the content on the right side of web page. When the tree is expanded it shows the item as (before clicking the
How to use json to build a nested list
I realize this is probably one of the most common uses of JSON, but I'm hitting my js knowledge limit. I want to output a two-level <ul> using a json structure. How should I structure the json and then how to output it? Any help greatly appreciated. Desired output: <ul> <li>Topic 1 <ul> <li>Item 1a</li> <li>Item 2a</li> </ul> <li>Topic 2 <ul> <li>Item 1a</li> <li>Item 2a</li> </ul> <li>Topic 3 <ul> <li>Item 1a</li> <li>Item 2a</li> </ul> </li> </ul>
User tabbing through accordion control -> Can it automatically go to next section?
Not sure if this is the most appropriate forum, but I'm a jQuery newbie, so figured I'd start here. I put an accordion control on a web form, which seems to be working great! $(function() { var activeDiv = document.getElementById("<%= activeDiv.ClientID %>").value; var activeDivNum = parseInt(activeDiv); $("#accordion").accordion({ autoHeight: false, collapsible: true, active: (activeDiv == "'false'" ? activeDiv
Modifying hoverintent options in Superfish does nothing to extend visibility of menus
I've cranked up the numbers for sensitivity, interval, and timeout, and the site seems totally unresponsive to my changes. I've double-checked that hoverintent.js is being called, and it definitely is. var cfg = { sensitivity: 7, interval: 5500, timeout: 1000 }; I don't get it. Anybody have any ideas? Is this a common problem?
dictionaries and dynamic dictionary keys
Hi guys, this question is more related to Javascript than to jQuery but I'm hoping one of you guys can point me in the right direction. I'm trying to write a generic javascript function which will populate a secondary SELECT list based on an option selected in a primary SELECT list. The data for the secondary list is retrieved via an ajax getJSON call. This is how the function looks like this: function loadSecListFromPrimList(primListID, secListID, urlKeyID, loadingText, nonAvailText, ajaxURL) {
help me.
my html like this <dl id="horizonal-menu"> <dt><span>Menu<span></dt> <dd> <ul> <li><a href="#"><span>Vertical Menu<span></a></li> <li><a href="#"><span>Horizontal Menu</span></a></li> </ul> </dd> <dt><span>Form</span></dt> <dd> <ul> <li><a href="#"><span>Html Form</span></a></li> <li><a href="#"><span>Ajax Form</span></a></li> </ul> </dd> </dl>when
cloning objects and changing its attributes dynamically
Hi, i have a simple form and inside form i have two drop downs and a button. Now when a button is clicked the whole tr (which hold tree td's) needsto be cloned below the first tr. My Requirements:- What i want is to change the id's attribute of the each drop down and button of the new cloned tr. i know clone is used to clone an element and i have been able to clone the objects, But stuck in the way to change id's of the new created elements. Looking for someone to help me. Thanks in advance.
using parent and children to manipulate items
Hi, I'm trying to manipulate items in a table using jQuery, using the parent() and children() methods of the "this" object. I think I'm not understanding how to use the parent and children methods correctly. What I want the code to do is to show the list and button within the <td></td> when clicked on, and then hide it when the newly shown button appears. You can try my code using the tryit editor on w3school. just copy and paste. http://www.w3schools.com/cn/html/tryit.asp?filename=tryhtml_basic
Any course in jquery in Hong Kong?
I wanna get to know more about jquery and I am totally new to this area thus I wanna learn from scratch. is there any of such course available in HK? Thx.
Show Only One Hidden Element
I have several divisions with a hidden division within them, like this: <div class="show_display_none"> Some text goes here. <div class="display_none"> More text goes here. </div> </div> <div class="show_display_none"> Some text goes here. <div class="display_none"> More text goes here. </div> </div> The style sheet defines the class display_none like this: .display_none { display: none; } If a visitor clicks on one of the parent divisions
sliding images with indicator dot
hi there, i am using a sliding image gallery and want to indicate the selected thumbnail by showing a dot below the thumbnail. i am new to scripting and have been trying tweak the code i found (which had the thumbnails at 50% opacity when unselected and 100% opacity when selected), using that code, i'm hoping i can instead make an image of a dot show at 100% opacity when the thumbnail above is selected and 0% opacity when the thumbnail is not selected. here is the script where i think i can achieve
How to pass field ID dynamically to show() and hide() methods
Hi, I am working on JQuery show and hide methods. I want to show and hide some fields. But those fields are dynamically generated. I have generated those field ids also dynamically. But i am unable to pass that dynamically generated id to the show or hide method. My code is as follows: please suggest me how to pass the ID dynamically. $("h3").click(function () { $(this).hide(); $('#trimnotesid1').show(); }); in the red marked place i have to pass the dynamically generated field id instead of static
<Option> Problem in IE but not Firefox/Chrome -- Javascript fix?
Hi again all, back with another hopefully easy question to fix. Please check this out in [b]Internet explorer[/b]: http://www.lindesigns.us/rma/rmaonline.html I googled for the answer, but could not come up with a good response in terms of my own script on how to make the return code fields EXPAND to full length when pressed like they do in firefox and chrome. Does anyone have a quick fix for this? It's all dynamically loaded except for the first 10 fields (Which i might as well take out anyway),
Unable to select id to set background-color
I am unable to set the background colors using a variable as a selector on id's that contain a space ' ' or forward slash '/'. Is there any way to accomplish this? May be my escaping the spaces or forward slashes? id='Income Range' Does not work id='Debit Card Holder' Does not work id=' Credit Card Holder' Does not work id='Credit Risk' Does not work id='Excellent Credit'
document.ready
I'm new to jquery. I did some pages in jquery. I'm confuse about the use of $(document).ready. Whether I put my code inside or out of $(document).ready, it works fine. In plain english, how can we describe the use of $(document).ready?
Site table Quick Search - How to.....?
I am really new to JQuery and really need a HELP. I am trying to build a site with a Excel table price list or Rates with more than 6000 cells of Countries and Cities but which tool do I need or how to go about it, I have no idea. The rates list is really long. What exactly I want to do is when people visit my website and want to know about a particular rate for a particular country, they just type in e.g. Mexico and the system will search the table and bring out all rates under Mexico. And there
OpenAJAX & JQuery
Okay, I am using OpenAJAX - and in particular the publish/subscribe unmanaged & managed hub implementations. I have several UI "gadgets" that I need to have messages exchanged between as facts change. I just switched one of my gadgets over to be a JQuery plugin. However, I am having trouble getting that plugin to subscribe to my published event. I found the following link that seems to suggest that others have solved this problem: http://wiki.javascriptmvc.com/wiki/index.php?title=JQuery but
adding and attribute to a class
Hello... I would like to create a mouseOver event that adds an attribute to a class, so that this... <div class="a"> <span class="1"><a title="Something" href="moo.asp" id="">Something</a></span> <ul> <li> <a title="Anything" href="foo.asp"><span>Anything</span></a> </li> <li> <a title="Other" href="foo.asp"><span>Other thing</span></a> </li> </ul> </div> <div class="b"> <span class="1"><a title="Something" href="moo.asp" id="">Something</a></span>
doing a toggle for div swapping, or div hide and show, need some help
Hello all I'm trying to do a quick and dirty jQuery toggle swap, I'm swapping the div ok, but I can't seem to work out how to swap back to the original. <span onclick="$('#original').html( $('#replacement').html() );">Click me to see replacement</span> <div id="original">This is the original content.</div> <div id="replacement" style="display: none">This is the replacement content.</div> <span onclick="$('#replacement').html( $('#original').html() );">Click me to go back to original</span> Maybe
Button problem
I'm trying to change the text on a series of buttons which are located in a series of dynamically added forms. The idea is that you can open and close the forms you need, but when you close one form it will automatically also close all of its sub forms as well. All this works fine, but now I need to be able to change the text of the buttons as well... and this for some reason that is beyond me just will not work. Each button has the following onclick event... javascript:jQuery.ButtonManager($('button#'buttonId'),
toogle menu
Hi, i´m using this basic script von the Jquery-site: $(document).ready(function() { var toggle = function(direction, display) { return function() { var self = this; var ul = $("ul", this); if( ul.css("display") == display && !self["block" + direction] ) { self["block" + direction] = true; ul["slide" + direction]("slow", function() { self["block" + direction] = false; }); } }; } $("li.menu").hover(toggle("Down", "none"), toggle("Up", "block")); $("li.menu ul").hide(); }); So far it works fine. I
toggle and links
Why links don't work when I use toggle() ? For example: <script type="text/javascript"> $(document).ready(function() { $("#menu li ul").hide(); $("#menu li").toggle( function () { $(this).children("ul").show(); },function(){ $(this).children("ul").hide(); }); }); </script> <ul id="menu"> <li>aa <ul> <li><a href="/">aa2</a></li> <li><a href="/">aa3</a></li> </ul> </li> <li>bb <ul> <li><a href="/">bb2</a></li> <li><a href="/">bb3</a></li> </ul> </li> </ul>
capture a click event for an href within an element that also captures a click event
I'm trying to capture the click event of an href that appears within another element. In the code (below) I'm using I can see where the click event is being captured for the #dialog-box, which works fine. The problem I have is, within the #dialog-box I display the following code: <a href=tsnooze.php?ID=" + ID + " id='snooze'><img src='snooze.gif' border=0></a>. When I run the code, I can see the link when I move the mouse over the link, pointing to the correct place, but when I click the link it
Error with AJAX request
Can someone tell me why the $(this).html(data); doesn't work inside $.get ? instead of this, how can I modify the html inside $.get, because the alert(data); shows the data correctly. $(document).ready(function () { $('.item').each(function () { $.get('item.php' , { item_id: $(this).html() } , function(data){ $(this).html(data); alert(data); }); }); });
A Beginner question -please help
Hello dear friends, Iam very new on this forum. I have joined this forum today. Iam working on video sharing site with php, ajax and mysql. Iam not much aware about JQuery. Iam interested to know that is JQuery run on serverside if client has disabled javascript ? What changes should we make in coding ? I only want to run Javascript on serverside because opera mini support server side javascript. Please help me. Thanks
how to limit the add()'ing of a class to a single element - so when one is added, another is removed if it exists
I have a series of elements that I want to animate to give them focus by clicking and I currently am doing it through a toggle animate function. I was going to switch to adding a ".selected" class but what I need help with here is to remove the selected from the element when a new one has become freshly ".selected". Is there a good way to do this?
Loop through .
<div id="menu"> <ul> <li><a id="selected" href="index.html">home</a></li> <li><a href="index.html">Menu1</a></li> <li><a href="index.html">Menu2</a></li> <li><a href="index.html">Menu3</a></li> <li><a href="index.html">Menu4</a></li> </ul> </div> Hi, what would be the script for setting the id="selected" on the anchor elements. when a user clicks also should remove the id property from the previously selected anchor. Thanks
how do you click on a single object to work as a selector? need to target one of multiple objects with the same class
I'm new to jquery as you will soon find out. I have a number of divs with the same class applied to them and I want to be able to animate them separately as each one is clicked - right now clicking on one, affects the entire family of like-tagged. I think I might be going about this the wrong way or missing something. can someone help?thanks!
Next Page