Getting value from nested function
I just can not get the value of arr. Any suggestion... function my_f() { $.post('data.php', function(data) { var arr = $.makeArray ($("tr",data).map(function(){return $(this).attr("id")}).get()); return false; //alert (arr) //this work }); return arr; } alert(my_f()); //return undefined
Validating errors: for lightbox2
Hi I am just getting started using Lightbox2. I am using it for my portfolio. It works (even in IE) but when I validate it using web developer I get the following error message at bottom for every link. this is a sample of the code I'm using, it doesn't like the "rel" name, but when I changed it to "alternate" as suggested in explanantions, although it passed, it didn't work anymore. Does anyone have suggestions? I really want this to pass web developer, I would just feel better having it out there.
Traverse/Locate and get Other Class
The problem is that I get too much output. I would like to know the chain that would get me the other class name of a parent. I have several forms with two words for the class. Starting with a selected <option>, I can get it's parent, the <optgroup>*. I ask for the name in the <optgroup> and use this as if it were the name of the <select multiple>. This is working fine. But I am getting all the inputs from all the forms. Maybe I am over-thinking this. But the solution I am looking for is this: If
Syntax error
What is wrong with the syntax from the code below? I get SyntaxError: missing ; before statement: <!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=utf-8" /> <title>Untitled Document</title> <script src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <script> $(document).ready(function(){ $.getJSON("http://www.wikiwebwidget.com/api2/api.php?method=getAllUsers&jsoncallback=?",
Image Slider
OK, I am completely new to any web animation. I am looking for someone to help me figure out how to make an image enter my website from the left of my screen and end up in the middle of my screen. On click, I want the image to exit to the right of the screen. If someone can suggest a tutorial for this, or code that could help me move my image from one side of the screen to the other that would be great. Hope someone can help me.
need help (beginner)
Hello! I'm learning jQuery now. The following example has no effect: $(document).ready(function() { $("#cat1 ul").hide(); $("#cat1 li:has(ul)").each(function() { $(this).children().slideUp(400); }); $("li:has(ul)").click(function(event){ if (this == event.target) { var current = this; $("#cat1 li:has(ul)").each(function() { if (this != current) $(this).children().slideUp(400);
Mouse over enlarge image problems
Hi I am building a banknote site and want a page that shows a list of banknotes in a thumbnail list and further info on the right. i want the customer to be able to mouse over the image and this enlarges the same as used on ebay. I did have a thumbnail that when I use a mouse over effect on the larger image in a frame set up crushed all the other info on the page and looked terrible. I have tried to use jquey via a dummies book which tells me to download from jquery site but this message comes up
I have a problem with the animate() called by a input(unexpected auto shrink after the animation)
The code is like this: ======================================== <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> </head> <body> <input id="penis" type="text" value="This penis will shrink=("/> <button>Button</button> <script type="text/javascript"> $("button").click(function(){ $("#penis").animate({width: $("#penis").width()+'px' }); }); </script> </body> </html> ======================================== Every time the
Czech out the return value in jQuery
I'll check the value returned by the function if it was one thing and do another task, but it does not work otherwise? $.post('ajaxs.php', { name: name_, mail: mail_, matn: matn_, url: url_, id: id_ }, function (data) { $('#readmore').html(data); if(data == 1) { $('#readmore').css({ "border-color": "#00CC00", "border-width": "1px", "border-style": "solid" }); } else { $('#readmore').css({ "border-color": "#ff0000", "border-width": "1px", "border-style": "solid" }); } });
data attribute
How can I set a variable into the data attribute like shown? Thanks for your support! var xy = $(this).data('file'), xy1 = (klick +'1'); $('div[data-file=?xy1?])'.hide();
reset form after submission
hi guys,... can anyone help please,... I started new topic since the other one is an php format,... I need to reset form field after submission,... here is my form: <form action="/photo_comments/report_spam/80" id="ReportComments_80" onsubmit="return false;" update="updateReportPhotoComment_80" method="post" accept-charset="utf-8"> <div style="display:none;"><input type="hidden" name="_method" value="POST"></div> <input type="hidden" name="data[Report][sender_id]" value="47" id="ReportSenderId">
How to use an array with the selector "contains"?
I want to use an array with the selector contains, for example i have this jquery: $(".element:contains('word1'),.element:contains('word2'),.element:contains('word3')").each(function(){ $(this).css("display","none"); });And i want to simplify using an array: var x = ["word1","word2","word3"]; $(".element:contains(x)").each(function(){ $(this).css("display","none"); });How can I do something like that? Thanks in advance. :)
Selecting one element to change another
Hi, first post here! Let's say I want to select one element with an id of #myelement and a class of .active and then apply css changes to another element, say #thatelement So psuedocode mixed with real code I'm thinking something along the lines of : if ( $('#myelement.active') ) then $('#thatelement').css('background-color','green') Sorry if I made mistakes in that code, still trying to grasp javascript/jquery. Any idea how to say if the first element is true then make the css changes to the other
ajax call into dialog box with unique ID
hi guys,... can anyone help please,... I have a comments page with a link to report/spam that I want to call into dialog box with ajax,... how can I do this,..? thanks in advance,... here is my code: <script> $(function() { $('#photo_comments_opener_<?php echo $photo_comment['PhotoComment']['id'] ?>').dialog({ autoOpen: false, width: 500, modal: true, title: 'Report Photo Comment', open: function () { $.ajax(function(){ url: "<?php echo $html->url("/report/photo_comment/"
Help with Accordion -- Style Sheet Functions
Hello...Just download and integrated Accordion and it's working great. However, I'm having trouble with some basic customization (obviously I'm not a programmer!). Two things: I'm trying to re-size the accordion without doing any coding, so I just selected everything in the design window of my HTML editor and did a right indent of 10 pts. This worked great for what I needed. Except, it did not indent the drop-down menu box -- text in box was indented, but not the box graphic. How do I bring
Issue regarding slow image swapping on custom developed 360 image rotate with zoom
Hello, I may be a little out of my league here. I have not started using Javascript for that long, and Jquery a lot less, but attempting to learn each day. I have been asked to make a 360 rotating image view with a zoom function, it rotates, zooms, does so by loading the images externally and functions using UI sliders. The issue is the loading time when scrolling through/swapping the images when an image has been re-sized. It seems to function fine when the images are the default document/file width
Problem with keyboard interaction and JQuery/Jplayer
I want to use JQuery/JPlayer for a media art installation in which viewers can play and pause different videos on a screen by pushing a physical button. I therefore "connected" the play and pause function of JPlayer to a keyboard key. I'm a complete newbie in JQuery/JavaScript, but after two days of trial and error fiddling I got the code to do exactly what I want except for one thing that I can't wrap my head around: Here is my fiddle: http://jsfiddle.net/beluga/dYKgX/10/ You can play or pause the
Why did you downgrade your website design?
Hey, I've been a fan of jQuery for a few years now. Its an absolutely fantastic library and during that time I've seen jQuery itself and the website get better and better... but... all of a sudden the website has taken a huge dive in usability. What ever happened to the Documentation section that had that nice simple list of available jQuery functions neatly organized into Events, Effects, Manipulation, etc.? Ok so eventually I did find it again but its hidden away now instead of being easy to find
jQuery Tabs and Cookies problem
I have the following code and I am trying to retain the last tab clicked on with the cookie, I have tried everything but keep getting "$.cookies is undefined", 'it's driving me crazy! If anyone could help I would be eternally grateful <div id="tabs-smaller" class="tabs"> <ul> <li><a href="#tabs-smaller-1" name="tabs-smaller">Unassigned Jobs</a></li> <li><a href="#tabs-smaller-2">Assigned Jobs</a></li> </ul> <div id="tabs-smaller-1"> </div> <div id="tabs-smaller-2"> </div>
Create an array with a dynamic variable and another array
Hi there I have a loop that scoops up some regions(1) and lots of locations in that region(many and i want to push the region and it's locations to an array so effectively creating a 2 dimensional array structure will be lilke all = array ( region_name => array ( "location 1","location 2" "location 3")) region_name and the locations will be generated in a loop and so i the result will be lots of region_names etc etc I have been using array push but can only seem to get a one dimension array together
Jquery Load() a url in a div tag from resource located on a different Server
Hi, I am trying to open a url in a div tag with click of an anchor tag hyperlink. my code works fine for the resource located in same directory structure, but it fails to load the url located in other server(e.g www.google.com) Following is my code which is working for local resource. <div id="divlink"><a id="anchorid" href="/About.aspx">Click Div me</a><br /> $('a#anchorid').bind('click', function (e) { var url = $(this).attr('href'); $('div#divlink').load(url);
need help traversing/retrieving info
trying to create left right image traversing gallery, but i can't figure out what I'm doing wrong. No matter what I do I can't get the left and right buttons to bring up the previous or next image. main page: <div class="blackout"></div> <div class="view_comic"> <div class="close_view"></div> <div class="comic_navl" ></div> <div class="comic_navr"></div> <div class="comic_img"> </div> </div> <?php echo '<p>', $comic_data['name'], '</p>';
opening a new tab in browser when clicking on a link
Hi I saw an earlier post asking about links to a sep tab in the navigation. I want to do something similar but the link is on a thumbnail img that goes to another website. I want that link to open the website in a new tab in the browser in case the viewer is not familiar with the back arrow button at top of the web browser. How can I do this? I tried what was suggested for a previous inquiry but it didn't work. thanks so much, m
my lightbox doesn't work in IE8+
Hi, Can anyone look at my code and tell me why it doesn't work in ie? ehh thanks a lot! (function($){ $.fn.center = function(){ return this.each(function(){ $(this).css({ 'top': ($(window).height() - $(this).height())/2 + $(window).scrollTop()+"px", 'left': ($(window).width() - $(this).width())/2 + $(window).scrollLeft()+"px" }); }); } $.fadePage = function(param){ var defaults = { action:
text box when the picture load
function imageLoaded(trg){ var w=$(trg).width(), h=$(trg).height(),sc,x,y; if (h==20 ) return; clearTimeout(_loader); document.getElementById("loader").style.display="none"; $("figure").html('<img src="'+trg.src+'">+onMouseOver = function () ......') I want to add a text box when the picture load onMouseOver = function ()
How should i structure this?
Hey, I'm working on this custom title popup script attached. im not sure should i use $('#divid') more often or just save it var oe = $('#divid'); and use it for the rest of the lines. Any tips?
Text shadow color
Hi All, I'm trying to set a new color for text-shadow. I'm pulling the x, y & blur values ok, but when I try to set a new color, it keeps telling me "Invalid character: # " on line #8. var ts = $('.firstLetter span.fa').css('text-shadow').split(' '); console.log('tS: ' + ts); // tS: rgb(85,,85,,85),1px,2px,3px var x1 = ts[3]; var y1 = ts[4]; var b1 = ts[5]; console.log('Shadow-xyb: ' + x1 + ' ' + y1 + ' ' + b1); // Shadow-xyb: 1px 2px 3px $('.firstLetter span.fa').css('text-shadow', x1
Basic question - button icon not working
Hello, I seem to have a very basic issue: I try to add an icon to a button, but it is not added. The selector is correct, however, because I see the style of the (first) button has changed. <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <link rel="stylesheet" type="text/css" href="css/style.css" media="screen" /> <link rel="shortcut icon" href="favicon.ico" /> <link href="css/smoothness/jquery-ui-1.10.1.custom.css" rel="stylesheet"> <script src="js/jquery-1.9.1.js"></script>
Please help me with multiple deferreds
Hi, Please go easy on me, I'm very new to Javascript and JQuery. I'm doing some Javascript development for Microsoft CRM. My scenario is that I am adding contacts to an event (like a meeting). The screen shows a bunch of contacts which can be selected. Without going into too much CRM detail I am getting each selected contact and doing a service call to add it to the event, I'm using $.ajax to do this and adding the returned deferred for the add of each contact to an array. Some of these calls may
How to force user to enter 3 digits after decimal
I want to force the user to enter 3 digits after the decimal. For instance, 100.500 not 100.50 Is there a ready or easy masked input for currency to use for that purpose? Or is there a way to count the number of digits after the decimal? like if they are less than <3) { error should pop up }
I need help understanding this script.
Im following a tutorial and the person did not explain it well enough and Im pretty lost! So if you can just tell me what jQuery is doing! <body> <h1>My Website</h1> <button data-file="day">Day</button> <button data-file="night">Night</button> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script> <script> (function() { var link = $('link'); $('button').on('click',function(){ var
.on event not initiating?
Sorry to bring another question, but I'm a little confused here. I looked at the jQuery documentation and it states that the .on function can attach events to future and current content on the page. Well, it seems as if it's not quite working they way it should, or I'm doing something completely wrong. Here's my code: http://paste2.org/p/3106314 The searching works perfectly. The results are returned, and the table is correctly outputted (see: http://puu.sh/2foZ4). However, whenever I click on a
Function breaks somewhere? BUT WHERE?
I have the following code: http://paste2.org/p/3100049 And in the click function, it seems to break somewhere within the code. I put an alert function at the bottom of the click function, and it was never displayed on the webpage. So somewhere there's an error in my code causing it to break/crash. The breaking point is where after noticebox.html('Attempting login...'); Can anyone help me out here? This is honestly getting very frustrating. :( Thanks, any help is appreciated.
How can I make an website with pages fixed in the screen?
I am a beginner in coding so please have patiente and try to give me some tips for my problem. I would like to make a personal portofolio website and I want to have pages fixed in the browser like this website: http://www.duemonete.it/ita/ Who can I get start with css, or structure ? I don't know how to start to do it. Some tips, please ?
Radio Button Not Staying Selected
Hi, I am new to jquery and am trying to centralize my code to make it run smoothly for areas of my form that repeat the same basic functionality. I have a ton of yes/no type radio button questions that will make an additional section of form data appear. I have it successfully show the "div" but then the radio button selection disappears from the UI. Please see my jsFiddle http://jsfiddle.net/jqueryNoviceUser/vY5fn/ that demonstrates my issue. Any help would be greatly appreciated!!! TIA!!!
Override url
Hi, I have a plugin that's sending users to the wrong url when on certain pages, so I want to override that url. Tried the following which checks if myloc ends in faq.html, if it doesn't (false) then I need to pull the url for "ul.navlist a" & force page to go to it. I've tried putting return:false in there, but can't seem to get it running. $('ul.navlist a').click(function() { var baseloc = $(location).attr('href'); // get current pg's url var stringCheck = "faq.html"; var myloc =
inputdate. caught as the value?
<input type="date"> caught as value?
Display a div when item is selected in select box.
I want to display a certain div when an item is selected within a select box. So far I got the coding below which works fine in IE, but chrome is displaying the div whenever someone clicks on a random spot within the select box (thus not by selecting a value). How can I make this work in all browsers? <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.1.min.js"></script> <script type="text/javascript"> function toggleDiv(divId) { $('.complete').each(function(index)
Updating text with inner html returning cannot read undefined
I have this java code function updateprice(pprice, ppricediv, pform, popt) { var totAdd = pprice; var thisopt = popt; if (!isW3) return; var pDiv = document.getElementById(ppricediv); totAdd = totAdd + pricechecker(document.forms.pform.thisopt.options[document.forms.pform.thisopt.selectedIndex].value); pDiv.innerHTML = formatprice(Math.round(totAdd * 100.0) / 100.0, '', ''); }and it returns; Cannot read property 'thisopt' of undefined this is what I'm doing this; onchange="updateprice('382.49'
jeasyui datagrid load data error
I have minor error at using the jeasyui datagrid.......when I page refresh my website then the datagrid view doesnt display the data........It shows only footer of the grid at the top of the div....data is displayed in the datagrid after pressing the refresh button........I also used jqueryui.com tabs. conflict is occured between tabs and datagrid. When I disabled tabs jquery files then the data in the datagrid is displayed well, other wise only showed footer of the grid which is attached file..How
Next Page