infinite scrolling only div part and not hole page
hi! i want to load specified div for my infinite scrolling, not hole page. i know i have to use valid jquery selector at load, but i make it wrong always in my testings. i used below code for page scrolling, but how i make it to only div loading scrolling and not hole pages? jQuery(document).ready(function() { //location.href = 'index.html#start'; var pages = new Array(); var current = 0; var loaded = new Array(); $('#pages a').each(function(index) { pages[index] = $(this).attr('href');
Random infinite scroll and doesnt repeat already published divs
Hi, I have infinite scroll with JQuery. But repeats already published divs when scrolling down. I want that randomly (from about 7 different div content pages with each page having an x number of div content, those div contents are news articles), a random number of artcles are taken from each page and published on my home page. And that this process repeats itself till all artcles, over all 7 pages, have been published. So, no repeats happen on my home page. I am breaking my head over this one.
problem with if istruction.
Hello everybody, I need help how to set if instruction in case where the final part of a condition is equal. I mean I have many strings like AD01, AD02, AD03, AD04 and then C100, C101, C102 and so on, I tryed to set in this way: if (mat == "AD*" || mat == "C*") some thing ... but not working How can I set my condition instead to set many times if (mat == "AD01" || mat == "AD02" || mat == "AD03" || mat == "AD04")? Thanks in advance. Tegatti
set hashtag and it word color before submit.
hello. sorry my english language isn't good. i used hashtag system in my website. but i want now before submiting post by user, hashtag and it word will get blue color. in fact like twitter. like this picture. thank you. if is require to my code, i will put to next post.
Referencing jquery to html in many sources
1. <script src="jquery.js"></script> (downloaded jquery uncompressed file) 2. <script src="http://code.jquery.com/jquery-2.1.3.min.js" ></script> 3. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js"></script> Is there any differences between these three? Which one should i use?
Binding touchstart to body causes iOS hover delays to disappear
I work heavily on the Drupal platform and several jQuery modules, but recently the Drupal Google Analytics module came out with an update that binds touchstart to the body in order to track clicks and taps for usage statistics. The only problem with this is that on iOS (most recent 8.x in my case) it kills the delay on hover CSS selectors. I've created a very simple demo of this behavior here: http://codepen.io/johnny5th/full/KwamjJ/ and my Drupal issue is here: https://www.drupal.org/node/2404215
how to get key value from list Items in html format in jquery to show respective detail page?
Am newbie to jquery.. I have tried to get json array in html format using ajax call in jquery.. then I have tried to show the respective detail page when click on item in item list.. how to get key value from jquery?? .. I have tried to search in net .. but didnt get clear idea.. Below mentioned code: <!DOCTYPE html> <html> <head> <script src="jquery-2.0.2.min.js" type="text/javascript"></script> </head> <body> <button id="action-button">Click me to load info!</button> <table id="info"></table>
php Form, Validation & Preview in same page
Hi , I already build a form as php_self , i want to make it validation and preview on same page ; 1 file only . The source code : <?php // validate data $fnameErr = $lnameErr = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["fname"])) { $fnameErr = "First name is required"; } elseif (preg_match("/^[A-Z][a-zA-Z -]+$/", $_POST["fname"]) === 0) { $fnameErr = "First name must contain letters and spaces only"; } else { $fname = $_POST["fname"]; } if (empty($_POST["lname"]))
sum not working
Hi there.. Could someone tell me why this code give me as result of totViewNav 1935 instead of 54 (the sum)? I premise that I'm putting this on a wordpress theme.. thx in advance! jQuery( window ).load(function(){ var halfWindowHeight = jQuery( window ).height()/2; var halfViewportHeight = jQuery('.flex-active-slide').height()/2; var viewportNavHeight = jQuery('.flex-control-nav').height(); var paddingViewNav = jQuery('.flex-control-nav').css('padding-top').replace('px', ''); var totViewNav = viewportNavHeight
using variable
I have the following code: var weight = ""; weight = $("#selectWeight").val(); if(weight == '') { alert('you must select a value first!'); } If weight has no value, I do not get a alert box. If I add an alert after getting the weight value, then I get the alert box. Is there something about using/initializing variables that I'm missing?
on() "mousedown" isn't working anymore. What am I doing wrong?
Hi On my site I want to change the href on all itunes links into a shorturl. I use this code. I think it worked before, but now it seems it has stopped working. Not sure why. No errors in log. Maby there's a more elegant solution (that's working)? jQuery(document).ready(function() { jQuery("body").on('mousedown', 'a[href*="itunes.apple.com"]', function() { var l = jQuery(this).attr('href'); if (l.match(/id(d{3,25})/g)) { jQuery(this).attr('href','http://tinyituneslink.co.uk/'+RegExp.$1);
Hover a div and change the class of the child div.
Hi All, I'm trying to create a sliding div inside a product on a product category page. But I can't figure out how to target just the div inside the div I'm hovering. Here is my js code ("jQuery" is needed instead of "?" in Wordpress ) ... <script> jQuery( ".woocommerce ul.products li.product, .woocommerce-page ul.products li.product" ).hover(function() { jQuery( ".product-info-slide" ).toggleClass( "showMe", "hideMe" ); }); </script> It toggles all the the .product-info-slide divs. I just want the
Problem accessing li element in ASP master page
I have problem to access li element with jquery. When I use an addon for chrom jquery selector everything works as expected. But without the addon the code doesn't display anything on hover Thanks < li class = "subMenuLi"> < a id ="AllRecipes_Link" href ="~/Pages/AllRecipes.aspx" runat = "server"> A to Z Recipes </ a > < ul id = "subMenuUl"> < li >< a href = "#"> Test1 </ a ></ li > < li >< a href = "#"> Test2 </ a ></ li > < li >< a href = "#"> Test3 </ a ></ li > </ ul > </ li > $(document).ready(
Snap pairs memory game
I have reached a coding stall in my abilities, can anyone advise me on how to make this game come alive, I believe I've done enough so you get the idea of what I am doing, it should be simple right? my code is here: http://jsfiddle.net/artworkjpm/qwe1njvd/ The game is simple, you select a number, one image pops up. You can select two numbers, if the images match, the numbers disappear. You need to find all the paired numbers. Any advice would be great. John.
jQuery not reacting to the change event
Hi, I'm glad this forum exits, I have written a jquery code to capture an change event defined on an select html element, which should trigger an ajax request to a PHP file, the data returned is used to update another select element. When I indeed trigger the change event on the first select element I don't see any change in the second select element. Firebug shows no errror in the console. html code of the select elements: <select name="sous-compte" id="sous-compte" class='selec' <!--onchange="selectdepartement(this.value)"
.click() and getting row ID from tables
Hi ! Let's say I have a dynamic table output from a database onto a PHP page that looks something like this - I have removed some columns to keep things clear : <table class="table table-striped"> <thead> <tr> <th>Name</th> <th>Actions</th> </tr> </thead> <tbody> <tr> <td>Tony</td> <td> <button id="banUser" type="button" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-ban-circle" aria-hidden="true"></span></button> </td> </tr> </table> When the button is clicked (i.e JavaScript
jQuery targeting an element I don't want targeted
I need to pull the submenu under the last element "inside" the box but ONLY when it's using the widescreen menu. To do that I need to grab the last element in the navigation, the submenu under it and then calculate how much the submenu needs to be pulled to the left. That I have no problem doing. My problem is I can't seem to isolate ONLY the navigation element in ONLY the #top-menu ul. The first step was just to isolate the last child element in the navigation. I'm stymied at the first step which
Compare ID and attribute and apply class
I have this HTML structure: <div id="our_mega_menu_wellness" class="our_mega_menu"> <div> <div> <a class="subcat_menu1" onmouseenter="submenu_display(this.id)" id="wellness22" href="">Emotional Well-being</a> <a class="subcat_menu1" onmouseenter="submenu_display(this.id)" id="wellness24" href="">Home & Family</a> </div> <div class="menu_article_content"> <div data-id="wellness22"> </div> <div data-id="wellness22">
the third argument in .data() method
hi there, I found something odd ( I think ) , in the owl carousel plugin . previously, I was a junior in js. I have read .data() on api.jquery . and I see this method only can enter a maximum two arguments . while at the plugin I see the developers enter the third variable . for what the third variable is? while at the api.jquery only 2 arguments . the code is: $.data(this, "owlCarousel", carousel); on line 1448. thanks before. and sorry for my english.
postmessage issue
Hi I am writing timer java script to get current time value in ui I am using following method to post message postMessage(minutes + ":" + seconds); but i am getting param issue, that i tried postMessage(minutes + ":" + seconds, "*"); getting message but it comes on widow.message event how can i get worker thread object? creating worker as w = Worker(test.js) test.js file sends postmessage //this wont work w.onmessage == window.onmessage is expecting , but i must stop worker as w.stop how
on selection of radio button jump on second accordion panel itself.
hello to all, i wanted to make accordion in a way, in my first panel there will be 2/3 radio buttons and a submit button. If on selection of a radio button and say submit, then next accordion panel will open. On second panel also few radio buttons and a submit buttons will be there. The same funda applies to the second panel too. Before selection of radio button, don't open second panel in accordion. Selection of radio button and submit must be there on both panel. Have created a code, but i dont
Inspecting objects in console output
How do you inspect Javascript objects, say, in console output? I thought I new the right answer - most browsers will show object values in console output by just passing the object. However, there is a fatal flaw - at least with Safari. The value shown is the CURRENT value of the object, NOT the value at the time it was logged! So, if the object was changed subsequent to logging, when you go to look at the log the object content will not be correct. The only time it can be guaranteed correct is if
Getting unrecognized expression while running my application after upgrading to “1.11.1” from "1.4.2"
I am getting below error while running my application. Error : unrecognized expression: value:("More Data Information") Here "More Data Information" is the text value inside a div. The code that causes the issue is as below. if(jQuery('value:("More Data Information")')){ jQuery(this).html('Safety Hazard Deficiency Areas'); return false; } I got this error message after upgrading the Jquery version to 1.11.1 from 1.4.2. I got this version number using console.log(jQuery.fn.jquery); Your timely help
Philadelphia - AboveNet - Connectivity Issues to code.jquery.com
Hi, jquery.com is experiencing lack of TCP connection availability and connectivity issues with traffic to Philadelphia-AboveNet (see trace route below). This results in browser errors in Philadelphia. Where can one open a ticket with the DevOps of jQuery.com? I am working to open a ticket with Philadelphia - AboveNet; however, this issue is at the jQuery end. Site Tested: http://code.jquery.com/jquery-1.8.3.min.js Traceroute Origination: Philadelphia, Pennsylvania - AboveNet Selected device eth0,
How to get progress of chunked file upload via ajax?
I have writen a jQuery acript that waits for file input change and then takes all the files for upload in chunks. I am using the FileReader API to slice the file apart. Now I get console log every time: a part of a file gets uploaded, the upload of last part is finished and the file processing on server starts and the when the processing finishes. What I need is to get the progress of the uploading in percentage for every file that is being uploaded (and make a console log of it, for example). That
Disable function keys using jquery
Hi Team, Is there any way to disable function key like f12 and developer tools using jquery.
Animation breaks on different screen resolutions
Hi all. The code below is expected to fade out the overlay and animate left property of two divs which are captions. Well, this code works like a charm at 1920x1080. It works as well in my tablet 7inchs (where overing is replaced by tapping). And the same happens in the 1024x768 res! But in my laptop at 1366x768 two things happen: mg_caption moves in only for 1/3 of its width mg_caption2 doesn't appear at all And the same happen in following resolutions: 1280x720 (mg_caption shows only a smallest
How to use php objects in jquery .push() or value method?
I have a table of data.I got this data after calling a SOAP request(web service).This data is showing in the table by creating objects of the array that i got from SOAP request.In front of all row there is check box.Now i want when i tick on the check box the result of the check box should be post to another php page.But i do not know how to pass there value to the next page. $xml = simplexml_load_string($xmlStr); foreach($xml as $datarow) { ?>
Executing callback function before .fadeIn effect starts.
The .fadeIn effect has a "done" callback option that allows you to complete the animation before executing the callback function. But there does not appear to be an option that allows you to execute the callback function before the fadeIn starts. Basically, I'm looking to execute and complete a code segment before the .fadeIn effect starts. Is there a way to do this? thanks.
how to refresh a jquery Datatable after an operation ?
Hi, I have a datatable, the first column show agencies assigned to this row, in another column I have a button that when clicked show a form to assign new agencies to this row, everything work well, but for the new agencies added I have to refresh the page to see them, is there any way to add them as soon as I click the button "Assign" ? here is an image showing what I am talking about : http://s18.postimg.org/9xtvp7w6x/rr_Agency.png Thanks. $("#divPopUp").dialog({ resizable: true,
Hide and Show an element by clicking the same button?
Hi, Please take a look at my code here: http://codepen.io/itsthomas/pen/vEKezr I want that when I click the button the text below it disappears and at the next click appears again. It works but just from the second click. The first click on the button doese nothing. Why ? What is wrong with my code ? Thank You
jquery dialog show and disappear when page load
Hi, I am using a jquery dialog, that is supposed to be hided until the open even, but noticed when the first time the page load I can see the dialog appears and hides quickly , is there any thing to fix this ? thanks.
Changes to DOM not visible to jquery plugin after JSON .append()?
I've scanned various DOM and JSON related posts here but nothing really hits on this specific issue yet. First, I'm using this great plugin called BookBlock: http://goo.gl/Zgvir Here's the situation: I load a page with an empty div I get a JSON call from Flickr with some photos I .append() the photos as <image> tags to the page I then call the .bookblock() plugin in the JSON success callback I can see all the images in the HTML at this point ... but the .bookblock() plugin/function only process the
getting status of django celery task from redis server with jquery
hello all, since days I try to find a solution to the following scenario - unfortunately I am not successful so far: I start a task with celery and I am able to receive the status with the following url: http://localhost:8000/task/status/b9901301-9bdb-4420-a6a2-c4e6c0963258/ what i get back when sending this url via my browser is: {"task": {"id": "b9901301-9bdb-4420-a6a2-c4e6c0963258", "status": "SUCCESS", "result": [[[0, 21.1], "OK"]}} this is fine so far. Now, I would like to check permanently
Move in - Move out ??
Here is the example I am working on: silkegaeng.com/working On the right-top corner you can see the Audio Icon. That should simply move the div "audioplayer" in on hover. And of course it should disappear on mouseout... What is happening is a strange effect, that it sometimes "shakes", moves quickly in and out, even when i dont move the mouse... whats wrong? jQuery(document).ready(function($) {
$('#audioplayer').mouseenter(function(){
$('#audioplayer').animate({right: '-20px'}, 200),
How to show value of checked checkbox?
<html> <input type="checkbox" class="check"> Smart Survical<br> <input type="checkbox" class="check"> Smart Survical<br> <input type="checkbox" class="check"> Smart Survical<br> <input type="checkbox" class="check"> Smart Survical<br> <li><input type="text" name="WIS" value="0">Cart</li> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".check").click(function(){
AJAX: intriguing problem passing special character...
I did solve the problem, but I found it so intriguing I wanted some opinions: I send a string to server with AJAX in classic way: queryStr = "?namePicked=" + names[0]; $.ajax({ url:"string.jsp" + queryStr, type:"POST", success:function(data){ $("#outputString").html( data ); }, error: function() { $("#outputString").html("fail"); } }); sometimes that name will include a special character, for example René this special char gets lost
Reusable multiple dependent dropdowns on same page
Hi jQuery Community, I am trying to create multiple dependent dropdowns on the same page I have been able to follow the following article http://wecamefrommars.tumblr.com/post/48854835407/codeigniter-how-to-make-mysql-cascade-dropdowns successfully and have been able to get one set of dependent dropdowns work on a page however I wish to have multiple dependent dropdowns on the same page. Currently when I have multiple dependent dropdowns on the same page when I change the first dropdown all the dependent
Simple jQuery accordion with Expand and Collapse option
Hi friends, I am here to share a Experience with jQuery with out additional plugin a simple accordion with Expand and Collapse option. Note : a Little hick up is while expand / collapse heading height variant will fix and update the post /*slide toggle funtion*/ $('.accHeader h2').each(function () { $(this).parent().find('.container').hide(); $(this).addClass('open close'); }); $('.accHeader li:first').find('.container').slideDown(); $('.accHeader li:first').find('h2').removeClass('close');
scrollTop() is not working
I just want to calculate the scrollTop value in chrome.But i am getting value as 0. Please help me to solve this issue.My google chrome version is Version 39.0.2171.95.Below is the my code: j(document).ready(function(){ if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1) { var scrollHeight = j("body").scrollTop(); j("#resultPageMenuBar").hide(); //Hide the result page menu bar alert("***************we are inside the google chrome browser***********"); j("body").scroll(function(){
Next Page