Conditional Function on Tables
Hello All, Im fairly new to JQuery and excited about using it. I have a condition that I trying to execute on a dynamic datatable on my aspx page. I have a value called "scheduled time" on my table in column 2 that should compare itself to the current time(new Date(); ?) . Based on the comparison the function below should happen... From my oracle database, the column2 is a variable timestamp called "SCHD TIME" if item is 0-15mins late, then table row is red if item is >15min<=30mins late, then table
Masonry question... make click a URL instead of larger gallery image
I found Gamma Gallery (linked below) that is very close to what I want. My problem lies in that this was intended to be a Gallery, so clicking on the smaller image rollover opens the larger image. I need it to be a URL link instead. [B]Gallery code link:[/B] [url]http://tympanus.net/codrops/2012/11/06/gamma-gallery-a-responsive-image-gallery-experiment/[/url] [B]Demo:[/B] [url]http://tympanus.net/Development/GammaGallery/[/url] My intent is to use it as a homepage with products in those positions,
Function passing parameters
How do I pass the value into the jquery function. Example: javascript <h1 id="h1_id" onmouseover="abc("paramenter 1");">xxxxx</h1> function abc(x) { } How do i pass parameters to Jquery? $("h1").click(function (x) { alert(x);
$("p").click(function () What does this the function really mean?
Hi, I'm getting a bit annoying. Although I know how to apply the code above. But I need to know what does function inside do. It make more sense to do this. $("p").click(paramter 1, parameter2, ...) { } Thus, what does the function () {} relli mean? What is the benefit? Secondly, I do see people do this $("p").click(greet) function greet(event) { The code will jump to here. }
changing span class changes ALL spans, how to make it specific??
I have pages with several <span> elements, each of which contains different text. I want to change the button color depending on the span text per se. All the spans are like this: <span class="btn btn-XXXXXXX">text</span> where I want to change btn-XXXXX depending on the value of text Problem is if I use a statement like this: if ($("span:contains('Check Out')")) { $('.btn').addClass('btn-success').removeClass('btn-primary'); } it will change ALL the spans on the page because the statement IS
How can I use "$.each" inside "$.each" ?
Hello, I am working on a one HTML page application that uses a REST web site to provide data and JSON to move data back and forth. My experience with JQuery and JSON is quite limited. I have a question on how to use $.each inside $.each to produce a nice display. I would like to post my HTML page below with comments, the page displays a set of buttons, I use jQuery to fill the buttons with a text and attach an OnClick handler, on click I call the REST service to receive an array of objects.
Odd FF/IE behavior with the .hide() method
Odd behavior In FF i get an error that simply says undefined, in IE it works: $("#msgresults").html(json); $("#myform").hide(); In FF this works: $("#myform").hide(); $("#msgresults").html(json); all that is switched is the order of the calls. The divs are as follows: <div data-role="content"> <div id="myform"> <form method="post" action="mobileverify.php" id="loginform"> <fieldset data-role="fieldcontain"> <legend>Login Information</legend>
Missing events.js file
I tried to use one of keypress event but it doesn't work. Seems like the events.js file missing. The url is http://api.jquery.com/scripts/events.js Can you update the file? Thanks
Slide show takes a few seconds to start working. Why the delay?
Hello; I am using a simple Jquery slide show here. But it takes about 1 second till its orgonized and starts to work properly! What I mean by orginized is that it shows all the photos in slide show for about a second, then hides the ones it has to and starts the slide show. What can I do to make this slide show working propely? Thank you
Dialog with options doesn't work
I'm trying to grasp how to use a dialog and have tried several examples. This first example works fine and the dialog opens as it should. <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css"> <script src="http://code.jquery.com/jquery-1.8.3.js"></script> <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> <script>$( "#dialog" ).dialog({ autoOpen: false }); $( "#opener" ).click(function() { $( "#dialog" ).dialog( "open" ); });
jQuery saves files?
Hello guys, I made an HTML page using some jQuery code, this page has the function of showing the result written in HTML textarea. So I was wondering if you can put a button to save the entire contents of the textarea format .TXT is possible? Thankful. My HTML page is this: http://ghfdhfg.forumeiros.com/h4- Note: I'm Brazilian, if they can answer in Portuguese'll be even more grateful :D
Getting objects referred to by other objects
I have a puzzle I am unable to crack. I am using a custom HTML attribute with the value being the ID of another tag on the page. I would like to get a JQuery set of all of the tags referred to that way by any tags on the page. For example, lets say I have: <h1 id="bob">some header</h1> <p id="larry">some text</p> <p myAttr="bob">...</p> <p myAttr="larry">...</p> <input type="Submit" myAttr="bob" /> I want to get a query containing all tags with an id equal to the value of any other tag's myAttr,
Deferred chaining , how should I do this?
I am looking to use $.when .pipe .pipe chains to accomplish the following task Step 0. - Get id from UI Step 1. - Query based on id $.ajax ({url:myurl, data:{id:id}}) - Should receive a response { "name": "dbtable" } Step 2. - Query based on "dbtable" $.ajax ({url:myurl2, data:{table:Step1response.name}}) - Should receive a response [{"name":"x"},...,{"name":"z"}] Step 3. - Work with response from step 2 to setup a data grid model Q1. Is there a relatively simple syntax to perform these dependent
jQuery datepicker & disable dates
3 weeks period booking example: 1st and 3rd week are available but the 2nd week is booked/not available. I have the "booked/not available" days/week disabled (not selectable) on my calendar. At this moment it is possible to select the "from" date somewhere in week 1 and the "to" date somewhere in week 3. For a room reservation this is not possible because the second week there is no room. Question: is it possible to disable ALL "to" dates after the booked/not available period?
Put button in column header
Hello, I am using MVC and JQuerry .. The problem is this, I need to place a button in the header of each column of the grid, this button will have a picture .. How I can put a button to each header columns in a grid???
Help me get parameters send with $.ajax. Thanks
I use: jQuery.ajax({ .... 'data': {'p1': 'p11111', 'p2': 'p222222222'}, 'success': function(){ //how to get p1 or p2 in send data object } });
drop function inside on dragstart function
This is my function iPictureframe.find("img").on("dragstart", function(event, ui) { iframe.find(".wpEdit img").on("drop", function(event, ui) { myFunction() }); }); My problem here is that, an on drop event handler will be added to " iframe.find(".wpEdit img") " so whenever anything is droped on " iframe.find(".wpEdit img") " it runs myFunction, but I ONLY want " iPictureframe.find("img") " to be only dropable element to run myFunction() How can i accomplish that?
Jquery nyroModal multiple instances
Hello, I am having a link which opens nyroModal popup on click of it. But when I click on the same when the popup is already opened, its not working properly. It should close the same instance & open again. How can I do that? I am calling following function for nyromodal. $(function() { $('.nyroModal').nyroModal(); }); Please help me. Thanks in advance.
Help needed !!
I am writing this code in a ASP.NET MVC4 Visual Studio application: <script src="~/Scripts/jquery.nivo.slider.pack.js" type="text/javascript"></script> <script src="~/Scripts/jquery-1.7.1.min.js" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery-1.7.1.js")" type="text/javascript"></script> <script type="text/javascript"> $(window).load(function () { $('#slider').nivoSlider(); }); </script> This is a code for a slideshow
hover image border disabled when i use $css
i have 2 images, and the border of each lights up when i hover of them. fine. but as soon as i pick one, no more hover highlighting. i am using a $css() border modifier in the code, and i am sure that is what is goofing things up, but i can't figure any other way to put a border around an image when it has been picked.. here is my code : <!doctype html> <html> <head> <meta charset="utf-8"> <title>my Gallery</title> <style> img:hover {border:2px solid blue;} a:hover{border:2px solid blue;}
Help needed in updating outdated jQuery code up to the latest version
So I was following a tutorial on how to fade out and fade in pages via jQuery: http://css-tricks.com/dynamic-page-replacing-content/. It worked, I got everything fading in and out smoothly, links were updating to add and remove the ".current" class on the fly. However, that tutorial was made for jQuery 1.4. I needed a later version of jQuery (the current one, 1.8.3) for something else on my site, so I just changed the jQuery link in my head to 1.8.3. This completely broke the navigation link class
Click() doesn't activate.
I've made this script to change attributes of a form. <script type="text/javascript"> $("#name_$gId").click(function() { $(function() { $('[name=debtForm]').get('debtForm').setAttribute('action', 'scms_actions.php?id=$_GET[id]&what=debt&do=edit&which=$editWhich'); $('[name=debtName]').val('$gName'); $('[name=debtAmount]').val('$gAmount'); $('[name=withdrawDeposit]').attr('readonly', false); $('[name=debtName]').attr('readonly', true); }); }); </script> But it doesn't do anything. I've tried putting
How to create a function with multiple functions
I have several functions in my .js file: (This is just an example, I know that the function is the same in this case) ;(function($) { $.fn.randomImage = function(options) { return this.each(function() { var defaults = {images: [ '<a href="page1.html"><br>Asia<br><img src="https://lh6.googleusercontent.com/-CMBwAQFvgmc/ULwxL0ciUfI/AAAAAAAAAA8/RhaVA3N_TKM/s720/Asia.JPG" height=125 width=200></a>', '<a href="page2.html"><br>Africa<br><img src="https://lh6.googleusercontent.com/-LZx9rZ_N7ZQ/ULwyGe1sOPI/AAAAAAAAABE/8iQpB5O7yys/s720/Africa.jpg"
.post issue
Hi I am having some problems using .post in the below code. I am calling the .post in the same file. So the below code in the login.php file is calling itself, and that might be part of the problem. I do not know. Basically the below code works, but it updates the source, but it will not refresh the page, so any elements will not be added to the page. I can tell the source is updated because in chrome if I go to inspect element it shows up in the resources tab, but it does not show up in the
Jquery working with IE but nothing else
Hi My page works great in IE but not in Chrome or FF. http://www.thestylishscribe.com/Jessica/faux-leather-passport-wedding-invitation.htm A few of the photos show above but others not at all?
Using the the return event in a jQuery dialog
In IE, event.target.innerText works and returns text that was typed in by the user. I need this to work in all browsers...of course :) Can someone show me how to get this to work in all browsers, so I know what the user typed in and can save it. I'm using ASP.Net and trying to save the information server side is the reason I put the returned text into a hiddenBasicInformationComments textbox (which is set to run at server). If anyone sees a better way to do what I want, please don't hesitate to let
Starting to learn jQuery but i know there is a better way to....
Hello All - I am pretty new to jQuery and am trying to learn about it as i develop something with it... I have the script below and it works kinda... but i know it can be written better, because if you click on facebook it opens FB like box and then if you click twitter it opens twitter and closes facebook. But then if you click on facebook again it only shows .facebook not .facebook & .likeus Can anyone point me in the right directions for closing the social options correctly by clicking on a different
remember toggled class state
Hi there, I'm new to the forums and pretty new to jquery, so I'm hoping someone can help. I have a pretty simple pane slider deal that works great as is, but I'd like to extend it a bit so that it remembers the state it's in rather than simple toggling. The reason for this is because as soon as I add and click on a secondary toggle inside the pane, the main toggle gains the active class when the pane is actually closed. So I use the primary toggle to open the pane, and inside that pane there is another
return value nested in function
Dear collective wisdom,Disregarding the API calls to sqlite in the following code, I want to reference selectLocation as a variable that returns the JSON object for later manipulation. I realize I cannot return this within the nested db.transaction closure, which is why I used the variable jsonOut to grab the object after it was assembled. The call to console.log("In:" + JSON.stringify(json)) writes out the expected value, but unfortunately, when I try assigning selectLocation to a variable, I get
how to insert custom title on my simple widget using append method?
Hello guys i have a pretty standard div with css and i would like to append to a div that already exists with a given class. here is my mark up <div id ="one" class="PortalBox"> </div> <div class="ab_Box1d"> <div style="width:600px;"> <%@ include file="./concur-reports/index.html"%> </div> </div> <!--finish ab_box1d--> </div>so basically I'm trying to append the markup in jquery when i stumble upon any div with class "PortalBox" however i need to make a part dynamic which would basically be a title
Javascript Image ComboBox - Sticky
I'm having some trouble getting the navigation to remain 'sticky', leaving the selected option in the menu when the user navigates to the desired page. Anyone familiar with this script have any ideas? Much obliged.... http://adamfialkov.com/v3/portfolio.php?folio=atlantic Thanks!
fadeIn() when div is floating
Hi guys, today a problem with "fadeIn()" occured, when i was trying to fade in some floating elements. I tried to figure out whether it is a known bug or not, but i couldn't find any information about it. So i came here to ask you for help! I have the following html code: <div id="someField" style="float:right;"></div> When the user clicks on a button, this div should fade in by using the following code: $('#someField').fadeOut('slow', function() { $('#someField').html('SomeContent');
Selecting text from box that was clicked
Hi guys, i currently have a page which has lots of boxes with different data in them like this: <div class="box"> <div class="box_name">Test Name</div> <div class="time">12:45</div> <div class="message">A message</div> <a href="#" id="button">View Content</a> </div> and i want to grab the value which is inside the time class div and pass it to the popup box. currently this gets the value: $('#button').click(function() { var time = $('.time').html(); but because the .time class is used
json and jquery ajax
Hi I want get data from php with jquery.I wrote this code: in php: <?php $return=array('content'=>1,'id'=>2,'priiority'=>3); echo json_encode($return); ?> in jquery: $.ajax({ type:'post', url:'next_prev.php', data:{act:act,id:id,priority:priority}, dataType: 'json', cache: false, success:function(data){ var obj=jQuery.parseJSON(data) $('#content').html(obj.content); $('#priority').html(obj.priority); $('#id').html(obj.id); }, }); but it does not work.whats wrong?
Need help for Jquery Validator
Hi, I'm in a serious trouble. I'm using jquery validator in my application. In one of my form there are two different button like below . <button id="uButton" name="uButton">Update Booking</button> <button id="sButton" name="sButton">Save Booking</button> Whenever I clicked on any of the button my validation methods being checked and i got the for submitted. Up to this all is ok. But what I want is - based upon which button click i want to sent a value in one of my hidden element. <input type="hidden"
In a Superfish Jam
I was referred to this site from another related to Superfish and really need some help. I'm helping a friend convert from their old Joomla 1.5 site to 2.5 and likewise from the previous version of the Superfish module. I've updated the stylesheet as best as I could but I'm really stuck on a couple things. First, I can't figure out how I got one menu to dropdown the submenus but another one wont. And I'm wondering how to get the home link off the homepage. For some reason when I change the name of
check ajax output if changed
Hi, I'm newbie to jquery. Please, could someone check my code and give me any idea how to improve? what i have: input which value is checked by ajax and result is printed on screen in new input. i make string url from item name. but the problem is, that new input should be changed again. how to double check, please? my codes: $("#naz").blur(function() { var form_data = { nazev: $("#naz").val(), is_ajax: 1 }; $.ajax({ type: "POST", url: './check-url.php' , data: form_data, dataType: 'html', success:
disable() VS lock() in jQuery.Callbacks
When I digged into jQuery.Callbacks in jQuery source code, I confused about the difference between disable() and lock() function. My question is 1.in which case use disable(), and in which case using lock(). 2.what the "stack" variable used for? The code is below: disable: function() { list = stack = memory = undefined; return this; }, lock: function() { stack = undefined; if ( !memory || memory === true ) {
Selecting all elements of particular data-theme
Hi folks, I want to select select all the button id with particular data-theme inside a div tag... how to do this...
offset() method in CSS 3 multicolumn
Hi all, I have some serious issue here, I'am working on an iOS App which has to display an html page in a UIWebView over several columns using CSS multicolum module. I'm adding the following CSS rule to the page to accomplish the multicolumn padding: 0px; height: 850.000000px; -webkit-column-gap: 0px; -webkit-column-width: 620.000000px; Then I need to find the absolute position on screen for some text in the page. The problem is that any call of the offset() method from jQuery works fine EXCEPT
Next Page