Getting dialog position, seeing if dialog is open, or closed , and saving all to a cookie then retrieving info back.
As i am really new to jquery, only been messing with it for less than a week. Heres my problem, i just need a push to help understand this a lot more. I need to be able to retrieve the coordinates from a dialog, And then save it to a cookie. and then how do i retrieve it? Also if the dialog is open or closed. I would be really thankful if you can post some code.
get a value from a complex json, using jquery
Dear All, I am trying to get the value of ArticleTitle from a complex json output using jQuery. My code is $(document).ready(function() { $.getJSON('efetch.json', function(d){ var ti = d.result[0].MedlineCitation.Article.ArticleTitle; alert(ti); }); }); It should be very straight forward? I am very confused. Thanks a lot. Below is the efetch.json {"result": [{"MedlineCitation": {"DateCompleted": {"Month": "06", "Day": "09", "Year": "2009"}, "DateRevised": {"Month": "05",
requesting data periodically
Hi, I am new to Javascript and jQuery. Basically, I am using the GoogleMaps API to plot markers on a map. I get the lonng/lat data from a database. I initially fetch the data from the database through a request to a PHP script as follows: $.getJSON("mapservice.php?action=listpoints", function(json) { if (json.Nodes.length > 0) { for (i=0; i<json.Nodes.length; i++) { var location = json.Nodes[i]; addLocation(location);
Retriving textbox values
So I just picked up JQuery yesterday and I am trying to access the text of a dynamically created text box. Here is the code I am using. Please let me know what I am doing wrong. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %> <!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 runat="server"> <title>Untitled Page</title>
Scrolling text question
Hello everyone, im new in to jQuery, and im searching for a plugin/code example for text scrolling. I got some text in a <div> if text is longer than for example 300px it gets cut and is scrolling from start to end, stops for a second and then scrolls back, stops and all over, and if its not long enough than 300px then just displays normaly. Something similar to the Song name scrolling in in any MP3 player.
I'm a newb, and while I can figure most things out....
Pretty much new to jQuery and while I have managed to do a lot of what I want I don't have a clue here, so I am humbly asking for help. I have a calculation I need to make, so I searched around and found jQuery Calculation Plug-in (v0.4.07). As a test, I included the various .js files that I need to make everything work on a small test page and have been trying to create a small table of 1 row with 4 cells across. The cells are labeled pH, Cl, T and CT from left to right What I need to do is have
Seems to be treemenubug when trying to customize it?...
Hello, Now I finally got my menu working, almost :p I recently noticed that when u r using persist: location; and u start the navigation on ur homepage, then u click to enter ur first menu alternative, then when u repeat this procedure twice the menu alternative that has been visited twice is styled with the default link settings for a link visited, purple colour, thin text instead of bold as all the other alternatives has been styled with. I wonder if this is a bug that might be easy to fix or if
Whole page slider
Hi! I'm designing a one page site with a whole page slider, somewhat like on this site. So, when for instance you click on the right arrow, the current page content slides to the left, and new content slides form the right. I was able to make the current page content slide to the left, but am having problems with sliding the new content from the right. In code I've got this snippet: $('div#contact').css('right','-941px'); $('a#next').click(function() { $('div#home').stop().animate({ left:
VS Docs for JQuery 1.4.2
Hello, When will Visual Studio Docs be available for JQuery 1.4.2. JQuery 1.4.2 has been release for sometime but the VS Docs keep not being released. Does anyone knows the release date for this? Thank You, Miguel
Text box valiation.
I have 2 text boxes. If first text box is filled second one is not required and if second one is filled first one is not required. Only one needs to b filled. How to do it?
changing the value of the first option in a drop down list
Hi, I'm using a CMS, so I can't manually change the first value of an item The first selected word is <Any> and I wanted to make it <All> so I used this code: $("option[selected=selected]").val('all');unfortunately it didn't work, What did I do wrong? Thanks!
Using Find with an Each
Hello! I'd like to change the background color of the div.level2 I'm trying to use the each and the find statement to accomplish this but I can't seem to get the desired results. <table> <tr> <td> <div class="level1">11</div> <table> <tr> <td> <div class="level2">++22</div> </td> </tr> <tr> <td> <div class="level2">++22</div>
What's the syntax for using += with a variable when using the .animate function?
I am trying to animate the right margin of an element using += to continually add to the margin each time the function is called. I want the value to be a variable though and I can't figure out the syntax. Here's what I have: $('element').animate({"right" : '+=320px'}, scrollSpeed, ScrollEase); and Here's what I'm trying to do: $('element').animate({"right" : +=variable}, scrollSpeed, ScrollEase); Thanks for your help.
Add A Row using JQuery
I'm new php and javascript and am trying to edit an already created form. The number of rows in the form is currently hard coded. Example php for 7 rows: for ($i=0;$i<7;$i++) Is there away using php and JQuery to set the default value to 3 rows and onClick on plus image change from $i<3 to $i<4. And onClick on minus image change from $i<4 to $i<3. I would like to store the number of rows in the database, so after I submit the form, I can return to update it and the correct number of rows is shown.
Testing for display status
Is there any way to use an if statement to see an element is currently hidden or displayed? like: var child1 = $('#divImgH1'); if (child1.IsVisible()) { do something;}Thanks.
Menu Drop-Down Alignment
Hail everybody! I did a menu drop-down for my band website with jquery and CSS, it works, but I would like to change the alignment of the links. I'll try to explain. The Drop-down menu is a horizontal bar, with the links displayed side-by-side. OK. The point is that, the links are aligned in the left of the bar, and I would like to make it follow the menu button, without moving the bar. Is it possible? Here's the page: DarkHound TKS!!!
if ($('li:last').is(':visible')) { //go back to first element }
I'm working on a banner 'slider' with a next, and previous button. There are 3 li elements i'm targetting. In plain english, this is what i'm trying to achieve - "if the last li element is displayed, (visible) - then hide it, and display the first element.." if ($('li:last').is(':visible')) { // code to execute }Any help / suggestions well appreciated!
My first test
Hello everyone!!! :-))) Here I am trying to make my new own toolbar plugin: http://jquery.pastebin.com/RqnhHrFh The problem I encounter is simply I see the div with ui-widget-header applied (a dark div) but the button doesn't look a flat button as like I see in this page http://jqueryui.com/demos/button/#toolbar but just a simple button even without the icon. Then I tried also the click to see if maybe it goes calling the function with just a simple alert but it doesn't.... I would precise I loaded
Adding a jquery text enlarger button to my site
I'm using the Thesis Theme for wordpress (if that means anything to the potential answer to my questions) and I would like to insert a text enlarger/reducer button to my site to make it more accessible to my older clientelle. I've found code out for this use, but I cannot figure out how to add the code in my custom_functions file and then place it within my html pages. Can someone here please provide code for this and explan how to insert it where I need...?? Thank you very much for your time,
Passing a variable to JQuery()
Total Noob question: two objects on an html page. An event on object 1 effects object 2 $(".video_rg").mouseover(function(event){ var myTriggerId = event.target.id; var myTargetId = 'video_' + myTriggerId; document.getElementById(myTargetId).src = 'images/test_object_2.gif'; // this works // $('#myTargetId').src = 'images/test_object_2.gif'; // this does not });My assumption (we know about those) is that I am not passing
noConflict problem
Hi, I've done a little bit of research about the noConflict in jquery but I still need help to figure out what to change in my js script to make it work. so here are a couple of codes , no need to do it all I just want to understand what I should change in it to make it work with another version of jquery? thx in advance HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Slideshow works with Firefox but not with Safari
Hi there! I have a - i think - simple question. I made a simple Slideshow with this tutorial: http://tutorialzine.com/2009/11/beautiful-apple-gallery-slideshow/ Not exactly the same, but the basic functions are from this script. Here's the script for the slideshow: $(document).ready(function(){ var totWidth=0; var positions = new Array(); $('#slides .slide').each(function(i){ positions[i] = totWidth; totWidth += $(this).width(); }); $("#slides").width(totWidth);
Get started on a auto refreshing
Need som directions to find my way. First contact with jQuery. I want to auto refresh part of a page in a WordPress blog. already have a page geting the resoult i want from a include_result1.php and include_result2.php Want to make this results to be updated for visitor every 1 second. I am Using this: <script type="text/javascript"> jQuery(document).ready(function() { jQuery("#responsecontainer").load("include_result1.php"); jQuery("#responsecontainer").load("include_result2.php");
[best practice] How to integrate multiple plugins
I've been struggling with this for a while now and I don't believe I'm the only one. So let's hear it, how do you call to different plugins on one page and not clutter it with DOM ready's? I'm currently doing it like this, but there's probably a better way: In the <head /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="jquery.plugin1.js"></script> <script type="text/javascript" scr="jquery.plugin2.js"></script>
Preplaces in IE
Hello everyone! I'm pretty new to jquery, so I guess, this board is the right one to place my problem. I made a little script where I'm replacing all the spaces " " with the html-code % 20 (without the space). Have to do it for maillinks to work right. The Script looks like this: <script> $().ready(function () { $("a#sendamail").attr("href", $("a#sendamail").attr("href").replace(/ /g, "% 20")); }); </script>It works in every browser (tested with Firefox, Safari, Opera, Chrome), except
How server-side get json from client?
I create a jsp file and use struts. In my jsp I use below code. $("#myForm").submit(function(){ $.post( "./MyAction.do?cmd=updateDb", { name:'panda', age:'23' }, function(text,state) { alert ("StatusCode:"+state ); }, "application/json" ); return false });When myForm is submit. jsp send json to server. I want to know what server-side should do to get the json.. I try this code but not work. It tell 'reader.readline() is null' public
Calling a function from a dialog box
Can a function that is on the main page or in the jquery lib be called from a dialog box after the dialog has been opened, eg I have a upload dailog box and I what to call the upload functions that will be on the main page for uploading the pictures. If this can be done, how would I do it. David
the bottom line: visibility in jQuery ?
Got a problem. Basically it's this: as I understand it, jQuery uses 'display' to hide/show, and I need similar functionality with 'visibility'. Here's what I've been using: $(document).ready(function(){ $('.hex').hover(function(){ $(this).find('.hN').show(); }); }) If you check this test page in IE7 (or IE8 in compatability mode) all the six-line figures are cut off at five lines: when you mouseover them, using the above function, the bottom line become svisible, and a number below it appears.
Automatic inclusion of external xhtml page in other pages
I need to include a Javascript script in each of several xhtml pages in each of my several domains to call a small free-standing xhtml page (consisting of some text and 3 images) located in one of my domains so that it is added seamlessly to the end of each of the pages as a footer. This is so that I can change the content of that single page at will and thereby update all pages without having to update 50 or 60 separate pages! How can I do that please? I have managed to include scripts for date/time
Issue using $(function () {...});
For some reason the $(function () {...}); code won't fire. I know it's correct because run it in the IE Dev Tools it works, but when I refresh the screen it doesn't fire. It doesn't make sence to me. Any ideas? Full code: $(function () { $("#Fields").hide(); $("#Location").hide(); $("#Profile").show(); $("#ProfileLink").click(function () { $("#Fields").hide(); $("#Location").hide(); $("#Profile").show("slow"); }); $("#LocationLink").click(function
togglescript used on radio input type
Hi all, I'm using the script below to display and hide a div when a radio button is pressed. However my problem is that when i go to click on the radio button, i have to press it twice for the radio button to appear checked. The div appears and hides when needed, so no problem there. $('input').ready(function() { // hides the slickbox as soon as the DOM is ready // (a little sooner than page load) $('#slickbox').hide(); // shows the slickbox on clicking the noted link $('.slick-show').change(function()
I have a small part of a paticular script that I can't understand, Can you help?
{ widget_id : $(widget).attr('id'), fetch: 1 }; This the paticular line I have truoble with. The script is from a 5 star rating system that does not use a database.. I got the script from here because I am new to JS so I got a head start. I have my own Active video list beside the Flash player. I have the video list entries numbered and I want that number to set the stars that should be displayed. e.g. Watching Video no. 1 See the Stars for Video no. 1 This script uses the id tag
Start a function after a user hasn't scrolled for 3 seconds.
I currently have a bid of code: (simplified) $(function() { $(window).bind('scroll',function(event) { var scrollTop = $(window.scrollTop(); if (scrollTop < 100) { $('#wrapper').removeClass.addClass("one"); } else if (scrollTop >= 100 && scrollTop < 200) { $('#wrapper').removeClass.addClass("two"); } // a few more else if but you get the general idea }); });Now I would like to perform function() {
Creating select box next to existing select box if it contains a certain value?
Buenas noches dudes and dudettes, I'm a total jquery noob, so this is probably very easy for you: I've got a couple of selectboxes on my page, all with the ID selFunction1, selFunction2 and so on... I want to create a new select box next to the preexisting selectbox if a certain value is selected, let's say "beaver". How do i do this? Thank you so much!
jquery placing a value in the textbox
Hi, I am new to jquery. I got the below requirement, a quick help will be more useful. 1) I will have a jsp carrying a text box. (Let us consider hello.jsp carry a text box called yourname) 2)The user calls the jsp with parameters in the url. For example, he calls the jsp as "http://hostname:port/appname/hello.jsp?name=jquery 3)When the jsp is loaded the textbox should display "jquery" Any help is appreciated.
addClass adds white space.
when addClass('choose') to li, there is always a white space right under it. anybody know the reason and how to solve it? thanks in advance. ------------------------ <!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; charset=gb2312" /> <script type="text/javascript" src="demo_inc/jQuery.js"></script> <title>无标题文档</title> <style>
Animate font size on hover
Hi I've been trying to find a way to animate a font-size increase on hover - which I'd expect is probably quite straightforward but so far I can't seem to find how to do it (and incorporate into below). I have a ul list using "hoverscroll" and would like to use it on this rather than just doing a straight CSS hover font size which is a bit naff. any help or pointers where to start greatly appreciated - thanks <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Capturing value of variable at time of .append
I have a for loop that generates a .append line for each item in an array. This loop is writing out a deli order, where each item on the array is an item on the order. One of the things in the appended line is a delete button that lets the user delete that particular item in the array. The .append looks like this: $('div#container').append('<input type="button" class="dltBtn" value="Delete" onmouseup="dlt(' + i + ' )" />'); The thing I'm looking for some explanation on is the dlt(' + i + ').
Possible to change hitarea on the jQuery treemenus?
Ive tried for several months now trying to replace the [+][-] boxes which expands and collapses the siblings with the text as hitarea instead, is there any way to accomplish this without preventing the standard settings? like persist: location, speed: fast, unique: true etc etc? Because Id really need just to change the hitarea from image boxes to text... I found that microsoft has a great example at following URL: http://www.microsoft.com/technet/security/bulletin/MS10-046.mspx If u scroll down
general syntax and behavior questions
Hi, My name is Avi. I just started using jQuery. 1. Although I have used JavaScript in the past I don't understand a certain syntax in the jQuery library. There's: (function( window, undefined ) { .... .... })(window);What does the opening and closing paranthesis of the 'function' mean? There's a casting of that object to a window object? 2. My second question is about plug-in behavior. Although it's a plug-in issue it's a basic question so I decided to place it here. I saw a plug-in samples and
Next Page