determine the element top
Hi, I want to determine the top of my nav menu so when the user scrolls up and the nav reaches top position 40 then I want to change its position to fixed. I tried below code but didn't work. kindly help.. <script type="text/javascript"> $(document).ready(function() { $(window).scroll(function(){ // if($(window).scrollTop() > 80) if($("#nav").position().top <= 40) { $("#logoheader").hide( "drop", { direction: "down" }, "slow" ); $("#imageSmallLogo").show( "drop", { direction: "down" }, "slow" );
Question about uploading files using Jquery and sending to c# webmethod
I need to upload files using a Jquery call. Anyone have success doing this. $("#chkBtn1").click(function () { var daFile = $("#file1").prop("files")[0]; // Append form data var form_data = new FormData(); form_data.append("file", daFile); $.ajax({ url: "testFileLoad1.aspx/processImages", //dataType: 'json', cache: false, contentType: "multipart/form-data", processData: false, data:
Update variable with ID name?
Hi, I'm trying to cycle through the children elements of a parent and store their ID's in a variable. But I am having trouble updating the variable properly. It's overwriting the variable instead of adding to it. I was wondering if anyone could tell me where the error is in this. *edit* ok I think I solved it actually. Though it's crude... is this an acceptable method? $("#size4").click(function() { var child; var idList; var newidList; $(this).each(function() { $(this).children().each(function()
jQuery .load() changes HTML attributes
I made a chrome extension that loads videos from the subscription page on youtube into the same page with jQuery using the jQuery .load() function (and then does some checks on it to see if they're new but that's not what I'm here for). A regular video container's thumbnail's imagetag that isn't loaded with that function looks like this: <img data-thumb="//i.ytimg.com/vi_webp/BQOXkEU-0T0/mqdefault.webp" src="//i.ytimg.com/vi_webp/BQOXkEU-0T0/mqdefault.webp" alt="" aria-hidden="true" width="196" data-group-key="thumb-group-0">
Having difficulty trying to use the parent option in calling a function from the parent script.
Hello, I have the following situation. I am attempting to use code already developed by someone else in .asp that works well. The asp script has a HTML element <div id="imageselected"></div> and a function shown as follows: function updatethumb(){ $('#imageselected').load('do_updatethumb.asp?pid=<% =pid %>¢er=<% =center %>'); } There is a 2nd script that calls the updatethumb() function doing a parent.updatethumb(). If I call the script from the address URL the first script works
How to Load Items into an Infinite Loop
Can you please take a look at This Demo let me know how I can load items into the ul list as an endless list. as you can see I have this list as following code but I need to add items again and again at the end of each time list. var item = $(".thumbnail").width(); var paddT = $(".thumbnail").css('margin-left'); item = item + 20; $(".leftslide").on("click", function () { $(".list-inline").animate({ left: '-=' + item + 'px' }, 300); }); $(".rightslide").on("click", function ()
Need help selecting <select> element
Hey Guys. I am trying to select a <select> element by its name attribute, and prevent the form from submitting to itself if the value is equal to hour or minutes. I have wrote the following code but for some reason the console is giving me the following error message Error: Syntax error, unrecognized expression: select[name=*'weekday_time_start'] I am not sure what I am doing wrong. Below is the js fiddle to my work. Thanks http://jsfiddle.net/eldan88/m3ewayca/ <form method='post' action='#'> Weekday
append adds two rows in ie9
Hi The following jquery code works in all browsers, except ie9. When resizing the browser window two rows of divs are displayed. But the height of the container is limited to the height of the content. What am i doing wrong? $(function() { var $window = $(window); var hasPrepended = false; var portDivs = ['<div class="port6"></div>','<div class="port5"></div>','<div class="port4"></div>', '<div class="port3"></div>','<div class="port2"></div>','<div class="port1"></div>']; function portraits()
Inserting Text into <textarea>
I'm creating a MySql 'query create box' trying to emulate the phpmyadmin() SQL routine. The code shown below works fine. What I would like is a critique on the efficiency of using all those <button> control statements. ie: <button type="button" class='sqlcontrols' id="insert" >INSERT</button>. Could I use the :active pseudo class selector in conjunction with class.sqlcontrols so that when the cursor clicks the button it is triggered. That way you would have only one line of code instead of 9
jquery.on('focus') function does not allow selecting the text in input text field
I have one input text field If I use jquery(document).on('focus',func) and call this.select() to select the text -> not work under IE11, works for FF31 If I use document.addEventListener('focus',func) and call this.select() to select the text -> work for both browser Test Environment IE11 64 bits under Win7 Firefox 31 under Win7 Test case http://jsfiddle.net/34e2h09t/22/ Did I make any mistake?
Smooth scrolling on scroll up/down
I need to animate a scroll from the current screen position up or down, when the scrollbar move up or down. I'm using this script, but doesn't work ok: var iScrollPos = 0; $(window).scroll(function () { var iCurScrollPos = $(this).scrollTop(); if (iCurScrollPos > iScrollPos) { $('html,body').animate({ scrollTop: $(window).scrollTop() + 100 }) } else { $('html,body').animate({ scrollTop: $(window).scrollTop() - 100 }) } iScrollPos = iCurScrollPos; }); The problem is that a loop appear on the scroll
Can I resize an iframe with a video in it, if other stuff on my page takes too much room?
I have page that shows a video, but also shows various text and other controls beneath it. I can't control how much vertical space these take - it varies. So I'd like to give the user two buttons - a enlarge-video button,and a shrink-video button. These would expand the video (I assume by expanding the iframe). I also have other pages that have the same problem, but they use a video-tag instead of an iframe Is there a way to just set CSS height of an iframe and/or a video-tag? Thanks. Gid
I have been told that my question is ambiguous. So I am restating it with some code
I have 6 img tags: <div> <img class="cards" id="img1" border=0 src="./images/blank.gif" style="left:200px"> <img class="cards" id="img2" border=0 src="./images/blank.gif" style="left:220px" > <img class="cards" id="img3" border=0 src="./images/blank.gif" style="left:240px" > <img class="cards" id="img4" border=0 src="./images/blank.gif" style="left:260px" > <img class="cards" id="img5" border=0 src="./images/blank.gif" style="left:280px" > <img class="cards" id="img6"
There is an error on .attr to get flash object attribute
jquery-1.9.1.js line 2370 ie 11 if ( typeof elem.getAttribute !== core_strundefined ) { ret = elem.getAttribute( name ); }why not if (elem.getAttribute) { ret = elem.getAttribute( name ); }
Displaying the length of array from a specific index.
Is it possible if I have an array; myNumbers = new Array[0,1,2,3,4,5]; alert(myNumbers); This displays 0,1,2,3,4,5; But how can I display 1,2,3,4,5 from index location 1 to the length of the array; myNumbers.indexOf(1, myNumbers.length) Is this possible or do I have to loop through them? Thanks.
How to move an image up from its current location if the mouse is over it
and move it back to its original position one the mouse is no longer over the image. And if the user clicks the image to place it in a new location? I am a total noob to javascript/jquery programming. I am a c# programmer transitioning to web dev so I can read and understand most javascript/jquery code. Please help.
Mousemove event on fullpage carousel
Hello All, I have i mousemove event to show nav bar on a full page size carousel. How can i prevent the event to be triggered each time the slide changes. Thanks This is the script: var timer; $("html").on("mousemove", function () { $("nav").css('visibility', 'visible'); try { clearTimeout(timer); } catch (e) {} timer = setTimeout(function () { $("nav").css('visibility', 'hidden'); }, 1200); });
Is there a way to move the screen to show a different horizontal "X" position of the screen via an icon
Hello, Probably another cant do question but I'll give it a shot. I have screens that scroll horizontal left and right. Is there a way to click on an ...arrow... icon to shift the screen to the left and right and not use the mouse to scroll left and right? Any ideas are greatly appreciated ... Thanx
Sliding Pop Up Button Open and Close
Hello Everyone. I am looking for a way to make the following code have the button switch between one color to another. Any suggestions would be great. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>slide demo</title> <style> body{ margin:0; } .pollSlider{ position:fixed; height:100%; background:red; width:200px; right:0px; margin-right: -200px; } #pollSlider-button{ position:fixed; width:100px; height:50px; right:0px; background:green;
$(this > 'li') doesn't seem to point to what I think it should
This is a continuation of my last post which I closed. here is my json file: { "Misc" : { "anymore" : ["anymore.ogg","anymore.mp3"], "dark side" : ["darkside.ogg","darkside.mp3"], "failure to communicate" : ["comm.ogg","comm.mp3"], "count" : ["count.ogg","count.mp3"] }, "Napoleon Dynamite" : { "Bow to your Sensi" : ["bow2sensei.ogg","bow2sensei.mp3"], "Cage Fighter" : ["cagefighter.ogg","cagefighter.mp3"], "Skills" : ["skills.ogg","skills.mp3"] } } here is my script: $(document).ready(function()
Border Adds: Hide and Show slide off to the left side of their container.
Hello. I'm practising JQuery and layouts and I'm confused as to why my border adds are sliding off to the left edge of their containers(divs) when I hide and show them. Here is what I have. Hope you can help! <div id="wrapper"></div> <div id="adds_left"><img src=""/></div> <div id="adds_right"><img src=""/></div> <div id="adds_bottom"><img src=""/></div> <script> var adds = ["#adds_right img:first", "#adds_left img:first", "#adds_bottom img:first"] var urls = [ "http://admin.csrwire.com/system/profile_logos/12774/original/wmt_logo_2.JPG",
getJSON callback with success?
Hi! I have build a weather app with jQuery, and everthing works nice. The url is https://api.forecast.io/forecast/ with a couple of parameters after that. I have created a bunch of variables to store the data. Finally in the end I do like this: var forecastData = function () { $.getJSON(url, callback); }; $(document).ready(function() { forecastData(); }); My question now if there's some easy way to handle errors, like if not null (if a param like longitude is missing), success/error
jQuery after loading div issue
Hello, I've got an overlay on my website which loads up when a button is clicked. Once the button it clicked, it parses a PHP file into a div which generates the content to be shown in the div. However, I can't seem to get the jQuery to work on buttons which are imported unless I call another Javascript file while populating the div. Does anyone know how I can get this so that it will work weather the buttons are there as the page is loaded or after extra content is brought in? I'm presuming it's
Uncaught [object Object]
Hi, I am getting the following error when code access CryptoJS.AES.encrypt(data, key); Uncaught [object Object] What should I look at in order to fix it? Additional info: Uncaught [object Object] (anonymous function) jQuery.extend.proxy.proxy jQuery.Callbacks.fire jQuery.Callbacks.self.fireWith done jQuery.ajaxTransport.send.callback
This app was to be detected high risk issues as DOM Stored XSS by scanning software CHECKMARX.please refer to it..
I developed an app using JQuery mobile . This app was to be detected high risk issues as DOM Stored XSS by scanning software CHECKMARX.please refer to it var daily_news_class_list = window.sessionStorage["daily_news_class_list"]; .... . $.getJSON(daily_news_class_list.replace("@categories", encodeURI(Category.replace('Today's News', ''))) 3874. .replace("@Start", 0) I updated JQuery.mobile API version 1.4.2, the problem will still exist. How can I solve this problem or whether the next
Bubblesort an Array from an index location.
Hello, I am stumped with the following. I have an array, scores = new Array[0,14,13,11,18,0,0,0,0]; that I want to sort from index 1 and ignore the zeros only sorting values above 0. So the array would end up like this, 0,11,13,14,18,0,0,0,0 instead of 0,0,0,0,0,11,13,14,18; Keep 0 the first zero at location index 0 Any other value with 0 after index[0] would be added to the end of the array. Thanks in advance, Paul.
I need to modify my code to accommodate new json file
This is my html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Movie Sounds</title> <link rel="stylesheet" type="text/css" href="movie.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="main.js"></script> </head> <body> <div id="main"> <header><h1>Movie sounds</h1></header> <div id="content"> <div id="sounds"> <h3><a href="http://jimslounge.com">Movie Waves</a></h3> <ul id="list"></ul> </div> </div> </body>
Stop a Parallax Slider from fading in and out
Hi I am working on this website: http://sunbgi.com/programming/adultblend/index.html I want the first slide to stay on the page without transitioning to the next slide, but it keeps fading to white and then coming back.. Is there a way to stop the animation just on this one page? <div id="parallax-slider-wrapper"> <div id="parallax-slider-backgrounds"> <div style="background-image: url('images/adultblend6.jpg');" class="parallax-bg current"></div> <div style="background-image: url('images/adultblend6.jpg');"
mouseover and related code won't work
In the below code I want the <td id='disp'> to be subject to toggling the background color. function showTable(peopleData) { var headStr="<br /><br />60th Reunion for Ridgewood Highschool Classmates "; var table_str=""; var prev=""; var i=0; $("#div1").append(headStr + "<p></p>"); // header table_str = "<table id='peopleTbl' class='center' border='4' cellspacing='6' cellpadding='4' bgcolor='#fff99d' ><br/>"; table_str+="<caption> Classmates 1954 RHS</caption>";
Removing mouseover from a hide/show
Okay, so as the title says, I want to remove the mouseover stuff in this hide/show page. I haven't done jQuery in a long time, and I don't remember how to take care of it without creating a glitch. Here is the page: EDIT: I removed the images so that it wouldn't be insanely cluttered, and spaced each line out so that everything would be easier to see. Sorry for posting it so sloppily. I was extremely tired last night and totally half-assed it haha. Hopefully this looks a lot better. EDIT: I have
Error jQuery 2.1.1 via YUI Compressor .NET
When attaching the uncompressed jquery-2.1.1.js file to the YUI Compressor .NET MSBuild task produces the following errors in the output window: Exception was thrown at line 2, column 10423 in http://localhost:52769/Scripts/myscripts.min.js 0x800a139e - JavaScript runtime error: SyntaxError Exception was thrown at line 2, column 10648 in http://localhost:52769/Scripts/myscripts.min.js 0x800a139e - JavaScript runtime error: SyntaxError Here is the Layout.master page inclusion: <ajax:ToolkitScriptManager
let jquery write javascript code to another js file
Is there a way to let jquery write code in an other file. so create the code in jsfile1 and than move that code to jsfile2.
How do I pass PHP string via ajax into variable array??? ( I´m a jquery noob..)
Hello, I´m fiddling with a Google Map script and I´m trying to update the map dynamically using ajax. On pageload the map initiates with an array of coordinates as markers/locations. The locations data is defined in JS like this example: var locations = [ ['Bondi Beach', -33.890542, 151.274856, 4], ['Coogee Beach', -33.923036, 151.259052, 5], ['Cronulla Beach', -34.028249, 151.157507, 3], ['Manly Beach', -33.80010128657071, 151.28747820854187, 2], ['Maroubra Beach',
Iam trying to get a floating side bar which floates between header and footer on scrolling.
but it is flickering at some points.pls check this fiddle, http://jsfiddle.net/ec4wjs48/10/
[error] too much recursion jquery-1.10.2.js:1239
I get the error shown in the title. Jquery doesn't work. I placed the jquery script tag in the bottom of the body and above the other js scripts. does somebody know how to fix it?
System.FormatException: Input string was not in a correct format.
I am using jquery-2.1.1.js I have a link on a grid where I can delete a row of data. When I click on the link, I get an exception in jquery thrown in this function; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; the msg value is /Quote/Delete?quoteId=10 This looks OK to me. In fact the runtime execution continues to do what I want after this exception is thrown. So how do I fox this?
Reading list of files from folder using jQuery
Hi Everyone How I can get list of all files from folder using jQuery. Plz. help on me this. Advance Thanking you.. I tried and no luck.. Correct me where I'm wrong. sample code : var fileNames = ''; $.ajax({ url: xmlFileName, success: function(data) { $(data).find("a:contains(.xml)").each(function() { fileNames += $(this).attr("href"); }); return fileNames;
Two click functions where the second one is requiring an additional click to fire.
hello everyone, I can not seem to understand why when the second div is clicked it is needing to be clicked a second time in order to run. Any help is greatly appreciated! $(document).ready(function(){ var $moveOne = $('#three'), $moveTwo = $('#two'); var r = 0, dir = true; $('.enable2').unbind().click(function(e) { if (e.target !==this) return; console.log('clicked'); dir = !dir; r = dir? -625 : 0; $moveOne.stop().animate({right: r+'px'},
my footer is moving using slideToggle()
I have a list in my footer with some links, and when I click in my last list element "See more links" I replace my list to another with jQuery slideToggle(). But when I do this I see my footer bottom go a bit down and up again. Do you know how can I fix this? I have my example here: http://jsfiddle.net/4ma6es6h/10/ This is my jQuery: $('.toggle').click(function () { $('#list1,#list2').slideToggle(); });; $('#change_links1').click(function(e) { e.preventDefault(); }); $('#change_links2').click(function(e)
Issue On Animating Div on Adding and Removing Animate Class
Can you please take a look at This Demo and let me know why I am not able to add the Animation to second click (Doesn't Matter Add or Update)in to the div I am using Animate.css plugin and the codes work fine for each one at first but after adding the removeClass() both of animation not functioning <ol class="breadcrumb"> <li>Model: Economics <span id="data"> </span></li> </ol> <button id="add" type="button" class="btn btn-default">Add</button> <button id="update" type="button" class="btn btn-default">Update</button>
Next Page