So I have a div with id "navigation" which contains an <ul>, and the <ul> has several <li> items.What I want to do is to animate the <li> items as i rollover them.My question is , how can I only animate the current <li> I rollover, because right now when I rollover one, all <li> items animate.
What code do I need to write to traverse above XML code to retrieve those userid value only when the selected=1???? And display the userid "A2" and "A5" with window.confirm in Javascript
I am currently attempting to write a function that retrieves the name attribute from a list of items with a specific class name. To illustrate: Code: Show types of food: <input type="radio" name="food" id="fruit" onclick="setVisibility('fruit')"/> <label for="fruit">Fruit</label> <input type="radio" name="food" id="vegetable" onclick="setVisibility('vegetable')"/> <label for="vegetable">Vegetables</label>
I would like create a function called setVisibility to iterate through all the list items where class=food and return the value of the name, so that I can compare that to the radio box, and set visibility accordingly.
What is happening is $(this) is no longer based on .expand being the (this) that is clicked.
like if i have a button SOMEWHERE randomly on the page with this
<div onclick="Minimize('_alerts');">Click Here</div> this will minimize alerts but because the (this) in minimize function doesn't actually point to the right button that I want to add a class to.
Is there a way to modify the minimize function so that it finds the <div id="mytoggle"><ul> <li class="expand boxminimize" rel="_alerts"> using the rel toggle, and then changes the class of the li from expand boxminimize to boxexpanded??
just like the .expand click function I posted on the top of the post that works?
Another thing that has been driving me crazy is that css positioning is handled differently by different browsers. JS is not my area, but I can do a lot with CSS, and I do, but cross browser compatibility is killing me.
I can use an IF IE statement and only IE runs that segment of code, but I haven't been able to figure out out how to make ONLY firefox or ONLY opera or safari enact an encapsulated segment of code. The same type of IF statement doesn't work for them.
Is there a single method using JS that works for all browsers?
function result(){ var result = document.getElementById('resss').innerHTML; }
But what I actually want is to import data from a table of an external website. E.g. I want to get the innerHTML of a specific cell in column 3 and row 2 of a specific site.
I would like to know how I can retrieve html data with jQuery. With my current project I have all pages in 1 html file (jQuery mobile). Every page has his own ID. Page 1 has id="question_1", and the next one is id="question_2".
Now I would like to retrieve this ID and add +1 to the question. So if you press a buton it will always go to the next page.
I am simply trying to retreive the value of a label. Here is the label: <asp:Label ID="Label3" runat="server" Text="I love ASNA"></asp:Label>
Here is what I am trying to do with JQUERY: See LINE 1 and LINE 2 below. It comes back with UNDEFINED/ < asp:Content ContentPlaceHolderID="PageScriptPH" runat="server" > <script type="text/javascript"> var ATTDTA_CLICK_ACTION_CODE = 'X'; var ATTDTA_DOUBLE_CLICK_ACTION_CODE = 'X'; wingsHelpers.subfile.assignDoubleClickAction( "ATTDTA", ATTDTA_DOUBLE_CLICK_ACTION_CODE); var p = $("#Label3").val(); <======== LINE 1 alert(p);<======== LINE 2 </script> </asp:Content>
I'm completely new to jQuery and Javascript but I have extensive (10+ years) with Flash and Actionscript.
I want to create a dyanmic tree menu, but I wonder what is the best way to get the data from a MySql database.
Honestly, compared to AS3, the implementation of XML seems very primitive... In As3 you simply move around the xml as if those were objects using E4X. This way: MyXML.myNode.myChild[3].text()
So I wonder, what is the best way to work with data from the DDBB? Is there a better way of using XML with jQuery? Maybe JSON?
JQuery 1.4. I cannot get this line to return anything but null: alert($(this).closest("div.cr").html());Any ideas on why not? I have tried using parents("div.cr:first") with no luck as well.
Here is my sample code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]"> <html xmlns ="[URL]"> <head > <meta http-equiv ="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript" src="jquery-1.4.min.js" ></script> <script type="text/javascript"> $(function(){ $(".mcf").live('submit',function(){ alert($(this).closest("div.cr").html()); //alert($(".mcf").closest(".cr").html()); alert($("div.cr").html()); //alert($(this).html()); return false; }); }); .....
I have a jQuery object upon which I am setting the 'top' value using the .css() method. The value is to Float accuracy:
$('#example').css('top', 13.857759); Setting the value works fine, and the result in the DOM is: <div id="example" style="top: 13.857759px;">...</div>
However, when I go to retrieve the value using the .css() method, the value is returned as an integer: alert($('#example').css('top')) // alerts "13px" Is this an intentional quirk of jQuery, or considered to be a bug?
I am new to jQuery and I would like to process a matrix operationusing PHP.The front-end code is done bellow, its a 3x3 table. the user couldselect/deselect individual cells of the table and click the buttonthat calls a PHP script that will run some function. How do I know if a cell is selected? Is there is is_selectedfunction in jQuery? Would it be possible to send a 3x3 array to my PHP script?Please provide me with any info on thisMTMy current test code.
I'm not sure this is the right group to post to, I've just found this group.I notice the old alt.dhtml group has been murdered, overwhelmed by spam. On my page: [URL] I am trying to get an element's style.top, style.marginTop, and backgroundColor. I can successfully do getElementById( ) on the element, but I can't get any settings from the element. If you bring up the page, all of this stuff is supposed to display in a header-like line just under the small banner. I can see that the doc's scrollTop has been retrieved OK (it wiggles if you move the vertical scroll bar) but all the other stuff is MIA. What am I doing wrong that I can't get this element's style properties? In the source, the function 'scroll(),' which is trying to read these properties, is at line 52.
<div id = "container"></div> <div id = 'containerItemTmplt' class = "ui-widget-content"> <div class='contentHdr' onclick="test(this)" /> </div>
i then use jquery to clone 'containerItemTmplt' and add it to 'container':
var copiedElem = $('#containerItemTmplt').clone(true). .attr('id', 'paneI1') .appendTo('#container');
This works great and i confirm using I.E. 9's developer's tool utility that the element was indeed added with the correct id as a child of 'container'.
However in my test method, when i inspect the element that was copied, the id attribute is an empty string:
function test(elem) { var parentItem= $(elem).closest('div')[0]; alert(parentItem.id); //<--this displays an empty string despite }
Is there a jQuery way for me to retrieve the placeholder attribute of a form input element? I've tried the obvious:
alert ( $ (
[Code]....
but it returns undefined in both firefox and chrome for some reason! All other attributes are displayed fine with the above code... is this a bug in jQuery? using the latest version. Is there a workaround?
I am new to jquery and i have no freaking idea about jquery. One of the requirement is to use Jquery to datastore and dataretrieval so on my aspx page, a user enters a comment and clicks on "Add" button.When user clicks on Add button, I wan to add comments to database. Once data is added to db, I also want to retrieve same data, user name and current datetime as a dataset and show it on the page. How can I achieve this? I am creating a webservice which accepts "comments" as parameter and stores into database.
I need to have someone give me a hint or show me an example where I can retrieve all the values of the options of a dropdown list, also I've created a dropdown list with Jquery and it looks good in all browsers EXCEPT IE7???? I thought that jquery was cross-browser compatible???
I have a MySQL database with a table where I store images (the file name, the mimetype of every file and the binary data in a BLOB plus a unique ID). Now what I'd like to achieve is to load an image from the database using AJAX and the POST method. Viewing a specific image using the GET method is quite simple, I just set the SRC attribute of an <img /> HTML tag to link to the PHP file and set the correct GET variables, there's no AJAX needed for that.I click a button or something, and 'behind the scenes' PHP is retrieving an image from the MySQL database, depending on the unique ID that was provided by AJAX through the POST method. AJAX uses the returned data to fill an element somewhere in the document, and that would be the freshly-loaded image.
Alright here's some code:
//PHP retrieving an image: $returnImageQuery = "SELECT imageName, mimetype, imageBinaryData FROM imageTable WHERE ID = $_POST['someID']"; $return = mysql_query($returnImageQuery );
I have a bunch of <div>'s on a page, each of which shares a CSS class titled "portlet-header". What I would like to do is retrieve the content inside each of these div's, and then construct a string of each div content separated by a comma. At the moment I can retrieve the total content from ALL of the div's sharing the "portlet-header" class by using: $(".portlet-header").text()
However, I was hoping that there would be a way of looping through each div of the shared CSS class in turn, constructing a string of the following format: div content 1 ,div content 2 ,div content 3 etc... I had a look at the .each method but couldn't get anything working.
I'm working on a forum. What I desire is to let user customize his own test. To do that I have to retrieve the user selected text. That's my problem. I don't know a jquery function to do that