jquery

jQuery in Wordpress doesn't work?

I'm trying to put some simple jQuery code into the Wordpress header (usually just use CSS) but no matter what I try I cannot seem to get it to work. The code is: <script type="text/javascript"> var fadein = 300; var fadeout = 200; $(document).ready(function(){ $("#btnforum img, #btnfacebook img, #btntwitter img, #btnyoutube img, #btnli...

How does JSLint's function-within-a-loop error apply when using jQuery's .each()?

I'm using a jQuery .each() call, which uses an anonymous function, from inside a for loop. JSLint comes up with the warning "Don't make functions within a loop". Here's a code snippet from a larger function - in essence it is doing a check of whether each player of the game is still "alive" (has at least one piece on the board). for( i...

select only third li

how do i select only 3rd( or some other no. of my chioce) li element with jquery? for ex: how do i change the background of only third li with jquery. any help please ...

find the type of html controls in javascript

How to find the control type in javasccript?. Say if i have an ASP.NET LinkButton and i wanna find control type from the javascript. How can i do that. I tried using typeof(), but it giving me an object back. and i tried var control = document.getElementById(Id);//Id is the ClientId of the Linkbutton alert(control.type);//this is empt...

Get value of textbox from another textbox with jquery

Hello, I have text box on 1.php like this <input type="text" id="1" value="somevalue"> & text box on 2.php like this <input type="text" id="2" value=""> 1.php and 2.php resides on single domain. I want to get value of textbox1 into textbox2 using jQuery How can I achieve this ? Thanks ...

JQuery: How to hide/display a div depending on the initial state of a checkbox?

Hello, Let's say I've this a checkbox and a div that contains elements that I want to hide/display depending on the checkbox being checked or not. <input type = "checkbox" id = "myCheckbox"/> <div id = "display-hide"> //Contains more elements </div> Now, here is the JQuery script that does the trick. <script type = "text/javascri...

When trying to remove any selected option in an select element, Safari shows it as blank

Examine this code. I'm using jQuery, but I think it is probably irrelevant. JavaScript ​$(function() { $('button').click(function() { $('select option[selected]').removeAttr('selected'); }); }); HTML <select> <option>a</option> <option selected="selected">b</option> <option>c</option> </select> <button>give...

IE8 and JQuery's trim()

Hello all, I am making use of trim() like so: if($('#group_field').val().trim()!=''){ Where group_field is an input element of type text. This works in Firefox but when I try it on IE8 it gives me this error: Message: Object doesn't support this property or method When I remove the trim(), it works fine on IE8. I thought the way I...

What is doing $.unique() function in jQuery 1.4.2?

I've got a string with no spaces with ',' and duplicate entries. Why jQuery do not removing this? var arr = $.unique(data.split(',')); ...

Jquery .hide() and .show() won't work in IE7\8

I am trying to .hide or .show IMG and DIV in IE, and it won't work for some reason. anyone knows about such issues? thanks ...

jQuery: How to cancel blur event if the element that will receive focus is a particular type?

I'm writing a custom form UI and currently building a select box replacement. The custom select control is basically a div with a hidden (off screen) select input in it, along with a span containing anchor elements mirroring the options of the select input: <span class="input select"> <span id="select-select1" class="select-input...

PHP Business days stop at weekends create a new start date on monday

Hi already i'm using this code from another question - which adds two extra days to endday in the case of weekends function add_business_days($startdate,$buisnessdays,$holidays,$dateformat){ $i=1; $dayx = strtotime($startdate); while($i < $buisnessdays){ $day = date('N',$dayx); $datex = date('Y-m-d',$dayx); if($day < 6 &&...

jQuery Date and TimePicker

I am trying to use the date and time picker located at http://razum.si/jQuery-calendar/TimeCalendar.html However this picker works only if the jquery-ui.js is not included. It looks like it conflicts with something with the base jquery-ui.js. The jquery core api is required. Any insight would be helpful. thanks in advance. The cod...

jQuery datepicker: manual firing of onChangeMonthYear()

Hey.. when I've got the function: $('#picker').datepicker({ // ... onSelect: function(currDate){ } }); I want to fire the function onSelect() manually, but $('#picker').datepicker.onSelect(); doesn't work.. how to fire? thanks for your answers and sorry for my bad english :-/ ...

jQuery: fading in a webpage only once

I have a simple script to fade in the homepage of the website, something like: jQuery(document).ready(function(){ $('body.home').hide(); $('body.home').fadeIn('slow'); }); However, I would like the script to work only one time, once the website loads initially. On subsequent clicks when, say, a user goes to a secondary page an...

CSSGlobe Easy Slider 1.7, how to restart animation?

Hi, i'm using the EasySlider 1.7 by CSSGlobe numeric version (http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider), in a project. When i click on a number the animation stops on the respective image, what I wanted to do is to inject another button that when pressed could restart the animation from where it stopp...

pass value as array/collection

I have this code: var addNew = $('#divListBox').find(':checked') .map(function() { return $(this).val(); }).get(); I want to know if there's a way to get all the value that's checked and put them in a collection so I can send it to my controller? ...

jquery click function and another jquery script

Hi, i insert many texarea's, and teaxarea's with tiny mce (WYSIWYG). But when i Insert this teaxarea's from this function Tiny MCS don't work. Why? Thanks $(document).ready(function(){ $("#InsertNew").click(function() { $('<textarea id = "tinyMCE"></textarea>').appendTo($('#textBody')); }); }); ...

mouse click somewhere else on page (not on a specific div)

I want to close a little pop-up box in page when user has clicked anywhere on the page other than box area. how to find it? ...

jQuery click / change function on radio button set

I have a radio button set called "pick_up_point". There are 3 options and clicking on an option will display a set of input fields relevant to the option. Now by default when the user clicks on an option I run the change() function which will run a function called "clearInputFields" - which as you might guess will clear out any text ent...