Jquery Sticky header
Hi, I want to create a simply sticky header when scroll in desktop version. But the sticky header not work in responsive version. How can I create it? Please help me. Thanks
Changing a css property after a certain scroll position.
Hello everyone, So my question is the following : My personnal website is divided into sections that are colored with different contrasts, so as I scroll past a certain section, I need my fixed menu to change its color css property. At first I tried to use boundingClientRect.top this way : $(function(){ var projetTop = $("#projects")[0].getBoundingClientRect().top; var menuTop = $("nav")[0].getBoundingClientRect().top; $(window).scroll(function(){ var calc = projetTop-menuTop; if(calc<0){ $("nav
Setting checked property
Hi, There are two things I'd like to do with the code below https://jsfiddle.net/yh0tao67/39/ Firstly, I don't know how to make the checkboxes "checked". To the best of my knowledge it should be $el.prop('checked', true) but by code doesn't work. Secondly, I can't help but think the I could condense the code down a little. The repetition of end() seems excessive. Does anyone have any ideas? Thanks, Dermot
jquery for textbox with one decimal point
Hi i am new to jquery.And i am assigned with the task now that my textbox has to accept integer values and float values.For floating numbers only one number has to be typed after the decimal point.I tried this code but it didn't work for me.i think my problem is with regex.Please suggest me some solution. $("input.cctxt").keypress(function (evt){ var theNum = $("input.cctxt").val(); // var regExp = /^\d{0,}\.\d{2}$/; //format .## required var regExp = "/^\d+(\.\d+)?$/"; //format
Radio button checked - add class to element
Hi - i have 3 radio buttons each with its own colour - red - white - antique white how do i detect if a certain radio selection is checked and then add a certain class to another element so it can be styled accordingly (not parent div). This is what i have so far http://jsfiddle.net/ung99hxm/4/
if any checkbox is checked in a checkbox array
Hello and thank you to those who have helped me in the past. I'm having a brain issue in reversing logic that I have successfully used in the past. What I need to do: I have a checkbox array. If any of the checkboxes (freeform_ch_cla_course_preferences_courses_001_1 - freeform_ch_cla_course_preferences_courses_001_5) are checked, I would like to addClass to a textarea (id="101"). Unfortunately, the code I have below, only works to toggle the validation. Thank you for any help in advance. Peter
jQuery Slot machine effect for images
Hi All, I am trying to create a button that would randomise Pictures with a "slot machine effect". Ideally I would need a clever random so that you would have to see all the pictures at least once before seeing an image twice. I was looking at http://jsfiddle.net/jakecigar/aMmhZ/12/ but I could not figure out a way to edit it the right way... the code would be something like this (I am using bootstrap): <div class="container"> <div class="row"> <div class="wrap" style="width: 400px;
How add Prefix to the entered value in SharePoint column using JQuery?
HI All, In SharePoint having fied with name no,i have to enter only 4 digits only in that column,once i tab out to another column the output have to come like extn:9876 can any one help on this,how can i get this functionality using JQuery.
SlideToggle return to initial click
Hey - how's it going? I'm using multiple slidetoggles on a page where the hidden content is quite long. I also have my slide toggle button beneath the hidden content, so when you get to the bottom you can close it. I've made up some code and got pretty close to what I want, very close in fact - but the problem is when the Close (2nd click) of the Toggle is made to hide the content again it always stays at the bottom of the page. What I want to do is return to the initial click event position, or
dependent drop down list remove/add selections
Hello, the code below has worked for me but unfortunately I am not an advanced enough coder to enhance the code the way I need it to be. What I need is the value of each options, to add |~|value_name. For example, if the first option is selected Cohort A, I need the value to be Cohort A|~| Cohort A. Any tips to point me in the right direction would be greatly appreciated. I know I need to improve my coding skills! Oh I forgot to mention, the purpose of the drop down menu is that I have 5 of them.
date sensitive hyperlinks
Hi. Is it possible to create a hyperlink that only works after a certain date? Thanks
using animate scrollleft on a div that has css scaling is not working properly
Hi, I got a div with multiple element stacked horizontally with a scrollbar (overflow-x:auto;overflow-y:none) if I don't apply a scale to the div it works find to position an element center but when the div is scaled, the scrollLeft isn't centering my element so I assume that it doesn't take into accound the scale. Any good idea or easy workaround for that ? $("#CalendarId").animate({ scrollLeft: $("#CalendarId").position().left }, 0); // This is necessary to go at the first element in the collection
Get Width of element and Increment
Hi, i need help with getting the width of an element and displaying a value. Basically i have a customer who is building a sign making websites. The sign is just text based but the pricing side is based on the width of the sign. So far i have worked out that every 32px is 5cm. The input field auto resizes based on the text within it. but i need to display on the site the size i.e if its 32px it shows 5cm then every 32pixels it updates in 5cm increments. 5cm (32px), 10cm (64px), 15cm(96px) etc...
jQuery hover/click on desktop and mobile devices
I have a menu with two categories: weather and snow. A visible icon and hidden popup menu. After hovering or clicking on the icon from the first div, it shows the second div popup. Hovering reacts on desktop devices, and click it's on mobile devices. Here's a part of my jQuery code: if ($(window).width() > 1025) { $('.weather').hover(function(){ $('.weather-popup').addClass('side-open'); },function(){ $('.weather-popup').removeClass('side-open'); }); $('.snow').hover(function(){ $('.snow-popup').addClass('side-open');
How to avoid this attitude?!
Hi, I have a sign in form wit ajax as per below code but sometimes it doesn't work and it just goes to this URL: http://www.mybluefile.com/m/policies?txtUserID=731004167&txtPassword=xxxxxxx&btnSignin=Sign+in It is is not frequently happening, maybe once or twice a week only... I am not sure why and when exactly it occurs.but I want to avoid it. here is the code: $("#frmSignin").validate({ rules: { txtUserID: { required: true }, txtPassword: { required: true } }, submitHandler: function (form) { $.ajax({
How to get folder path by using jquery
Dear Friends, How to get the folder path by using jquery? I have created tree view structure by using html tag <ul> and <li>. Example : <root folder> <parent Folder 1> <childer Folder> <child 1 folder> <parent> <parent folder 2> <childer Folder 2> <child 1 folder> <child 2 folder> </parent> if i click child 1 folder then the Folder Path should like : root folder/ parent Folder 1/child folder/child 1 folder how to achieve this?
Link a JS to a column in a list?
I am trying to I get the ID to attach(link) a JS file to the column. I first need to get the column value (a Date). Is my approach correct? $(document).ready(function () { var myValue = $( 'th:contains:"Title of column' ).val(); // Is this the right approach? function MyCustomFunction(myValue) { // my process to update the date } }
POST or GET for Sign in form?
Hi, I wanted to ask what would you use for a jquery ajax sign in form? POST or GET? Thanks, Jassim
Changing the colour of a div using click, toggle and fade in
Hi folks, I can't quite get this work, I've got the colour change working fine but get the fade in (with about 3000) to work. This what I've have so far. Thanks for help, cheers function toggleClass(el) { if(el.className == "class1"){ el.className = "class2"; } else { el.className = "class1"; } } ---------------------------------------------------------------------------------- <div class="class1" onclick="toggleClass (this)"> jQuery Click to Toggle</div> ------------------------------------------------------------------------------------
How to show new elements one by one?
Hello, I have 10 elements on a single page, on page load only want to show one, but at the top of the page I owuld like to have a little + or - that either add or show the elements in sequence, any idea how to to this please? Let's say I have: <div id="element1"></div> <div id="element2"></div> <div id="element3"></div> <div id="element4"></div> <div id="element5"></div> When I load the page I would like to see only: <div id="element1"></div> When I click + each element below show one by one but
Keeping focus when clicked outside of DIV
Hi, So I've made 2 buttons. http://jsfiddle.net/0y940r11/2/ I really can't figure out how I can keep the focus on the clicked button after I have clicked somewhere outside the buttons.
Change values in chart from row table
I need to create one table and one chart. When I click on row from table, the values from this row will be displayed in chart. It´s possible to create something like this ? I appreciate each link, tutorial or advice about this.
Can't select and hide any previous element in any shape or form
I'm about lose my mind with this problem. No form of jQuery selector seems to work in dynamically finding any elements above the link. I'm trying to access an element above the link and hide it. Using things like parent(), prev(), before(), closest(), ect. will show a non-null object but it won't respond to the hide() method. I don't get any errors, but nothing responds. [code] <div class="row"> <div class="col-xs-5"> <div id="test_fields"> <li id="test_input" class="string input optional stringish">
Basic question about jQuery OOP
I just decided to use OOP in a project I'm working on. And I had a basic question about reaching properties in the root of the prototype from functions that lie within objects. Heres a JSFiddle: http://jsfiddle.net/454onwr3/1/ (Open console) Heres the jQuery: var Person = function(first, last){ this._first = first; this._last = last; }; Person.prototype = { full: function(){ return this._first +' '+this._last; }, first: function( ){ return this._first; }, last:
Uncaught TypeError: Cannot read property 'not' of undefined
Hi, I am using a working file but when I just copied and pasted the file into a new file and added a PHP query I started getting: Uncaught TypeError: Cannot read property 'not' of undefined the URL is here: http://www.mybluefile.com/m User ID : 731004167 Password : 123456 and this file throwing the error is: http://www.mybluefile.com/m/myfile
Query CSS Selector Problem
Hello, This is my first post in the forum. I want to select all Product Reviews in the page: http://advancedledlights.com/3w-led-grow-lights/new-diamond-series-xml-10w-cree-xml/ I am using this selector: $("body>div#Container>div#Outer>div#Wrapper>div#LayoutColumn2>div#ProductReviews>div.BlockContent>ol.ProductReviewList>li>p:eq(1)") But it selects only 1 item. Thanks for your help, Best regards
How To Store HTML Markup Inside a Table Into an Array Using jQuery
Can you please take a look at This Demo and let me know how I can store html markup from a table td into an array as an item of array? I need to store the selected value of a row in an array and store in in database and eventually present it on the front end with button again. var arr = []; var d = new Date(); var month = d.getMonth()+1; var day = d.getDate(); var today = d.getFullYear() + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day; var user = "foo";
load() is unnesting nested UL / LI elements
Hi, Version: jquery-2.1.4.min.js Browser: Chrome 46.0.2490.86 (64-bit), Firefox 38.4.0 I could not demonstrate this with jsfiddle as you need more than one HTML file to demonstrate the issue. Furthermore, I could not report this in http://bugs.jqueryui.com/newticket as the drop down does not show version 2.1.4. Only shows up to version 1.11.4. Name this as loadTest.html: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>jquery load test</title> <script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
AJAX giving out of memory error
Hi, I don't know what is wrong here, the PHP or the call to AJAX. error is: uncaught exception: out of memory I suspect AJAX because the .php file populates the database properly. Here is my code with pertinent notes in bold. Thanks in advance for help in solving this. R. HTML CODE: <!DOCTYPE html> <!-- Comments about the program --> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title> GPS Information from Garman GPSmap76CSx </title> <!-- ==============
How to close a video (Youtube api, videojs5) in a Lightbox by click outside of the lightbox
I´m working on a Lightbox where users can open it for watching videos. I were able to close the video by click on the "close button" for the Lightbox, but if i click outside of the Lightbox i get this error: "Uncaught TypeError: Cannot read property 'stopVideo' of undefined". I know the problem already but don´t know how to fix it. The problem is : var player = $(this).closest('.modal-box').data('player'); if i cklick the close button the player can be selected, but if i click outside in the body
How to get input values if page refreshes?
Hello, I am using bootstrap and jquery to handle a complex form (also using Flue UX Form Wizard) Now on the last page I give a summary of the details the user has provided by managing the change() event, for example like ths: $("#street").change(function setStreet() { $field = $('#review_street'); $field.text($("#street").val()); }); Meaning if the user changes the street input field with the id "street" I also change it on the overview page directly. Now everything works very well except
unable to open navigation bar on swipeleft
Hi, I am trying to open the navigation panel grammatically when swipeleft but nothing is happening. Here is what I am trying: $(document).on("swipeleft", function(e) { if ($.mobile.activePage.find("#nav-panel").is(":visible")) { if (e.type === "swipeleft") { $("#nav-panel").panel("open"); } } }); Regards, Jassim
jquery function file only working in Firefox!
Hi all, I'm quite new to Jquery so please go easy. I've created a function file that does a few functions on a site i'm developing, mainly clearing search boxes and retrievining data with ajax etc. Everything is working great on Firefox, but on Chrome and I.E absolutely none of it works. I expect I may be missing something trivial but can't figure it out! Code is below: $(function() { $(document).ready(function() { $('#displayinvoices').change(); }); $("#clearinvoicesearch").on('click',
how to send values and load page using jquery
Hi, I want to pass a value to another page and display value there and load that page using jquery i tried following code $('#addr').click(function (e) {
e.preventDefault();
var url = "AddressForm.aspx?stid=" + encodeURIComponent($("#txtstid").val()) + "&clas=" + encodeURIComponent($("#txtclass").val()); // window.location.href = url;
$('#displ').load(url);
}); here i want to display AddressForm.aspx in displ div. and passing 2 texbox values.
Cookies not sent in cross-origin jquery ajax request when custom header set
[This question is also posted at stackoverflow : http://stackoverflow.com/questions/33808232/cookies-not-sent-in-cross-origin-jquery-ajax-request-when-custom-header-set ] We are making an ajax request from our main domain to a subdomain (cross-origin) using jQuery. We have CORS set up, and everything is working until we try to send a custom header with the request. If a custom header is set on the request, then our session cookies are no longer sent with the request. jQuery version : 2.1.4 Our
Fetch complete page including head
In the context of the plugin "Ajaxify ", I'm pre-processing the whole HTML, including the head of any target page, returned by an $.ajax() ...request like this: return String(h).replace(docType, "").replace(tagso, div12).replace(tagsc, "</div>") ...where: - h is the HTML fetched by the Ajax request - div12 = '<div class="ajy-$1"$2' and the others are RegEx's: docType = /<\!DOCTYPE[^>]*>/i, tagso = /<(html|head|body|meta|script|link)([\s\>])/gi, tagsc = /<\/(html|head|body|meta|script|link)\>/gi ...because
How to implement wikipedia api Using jQuery and java scrpit
I want to make simple one page web application with A form on top having text-box and search button result view area at bottom User can type any phrase in text-box and hits search button and he gets the phrase summary from Wikipedia. Test Case: Searching 'Ahmedabad' will result as : "Ahmedabad has emerged as an important economic and industrial hub in India. It is the second largest producer of cotton in India, and its stock exchange is the ..."
Dear All i need Help that how can i close my Nav by click out side the Nav
CSS Code nav { background-color: rgba(0, 0, 0, 0.6); height: 100%; position: fixed; right: -660px; top: 0; -moz-transition: right 0.2s linear; -o-transition: right 0.2s linear; -webkit-transition: right 0.2s linear; transition: right 0.5s linear; width: 660px; z-index: 9001; opacity:0.9; /* IT'S OVER 9000! */ } nav #menuToggle { background:; display: block; position: relative; height: 23px; left: -120px; top: 23px; width: 25px; } nav #menuToggle span
Issue with using $(document) with .html()
I am loading some HTML with some .js files to a DIV using .html().. If I load in the the same more than once, than my JS functions get fired off that many times..ex: $(document).on('click', '.folderOpen', function(){ alert(this.id); }); If I load the div 3 times, then I see that alert 3 times.. its like the head isn't clearing the .js files when the div gets repopulated. I tried .html('') and .empty() before it gets reloaded. Any suggestions?
How to customize Facebook Page plugin
Hello! Is there a way to customize (width, etc) iframe generated by the Facebook Page plugin -> https://developers.facebook.com/docs/plugins/page-plugin ? Thank You very Much!
Next Page