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
Understanding a simple function .
Given that "getRandomInt " is a function that generates a random number , what is happening on line 4 ? function rq() { var a = getRandomInt(0, 100), b = getRandomInt(0, 100), operator = "+-*" [getRandomInt(0, 3)], // whats happening on this line ?? answer = operator === "+" ? a + b : operator === "-" ? a - b : operator === "*" ? a * b:0; return ["what is " + a + operator + b, answer] }
Adding $.mobile.loading(''); to JQUERY MOBILE MULTI PAGES
I use the following code for single page: $ ( document ). ready ( function () { $ . mobile . loading ( 'show' ); }); $ ( window ). load ( function () { $ . mobile . loading ( "hide" ); }); When I use multi page template of Jquery mobile, the code only works on the first page of my app created by phonegap. How can I use them to all app pages?
Keyboard input with jqueryui autocomplete remote multiple source clears previous entries
I posted this in StackOverflow , with no joy, so I'm asking here as well. I have a jqueryui autocomplete widget that allows multiple entries and pulls from a remote source, and it works perfectly, with one major issue. That issue is that if the user provides keyboard input (e.g., arrow keys or page up/page down keys) to select an item, ALL previous items entered are cleared from the autocomplete. It works fine if the user selects an item with the mouse. It also shows the value, not the label, as
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
Autocomplete with AJAX and JSON not working?
I'm trying to fill an jQuery Autocomplete with JSON data from inside an Ajax function. This is what my script looks like: <script> $(function() { $( "#autocomplete" ).autocomplete({ source: function(request, response) { $.ajax({ url: "<?php echo $this->webroot; ?>portfolios/ajax_clients_dropdown/"+request.term+".json", dataType: "jsonp", data: {q:request.term}, success: function(data) { response(data);
How to make "val()" work in html form?
I have an online order form which works great! the only thing thats wrong is that i cant seem to find a way to send the input data from the text fields with Naam:, Adres: etc. (which is at the bottom of the code) i found out that i could use this code : $("#txt_name").val(); but it does not work properly. And i don't really know in which function i have to pace de code. Can someone help me? i'm not very experienced with jquery. <html> <head> <script src="http://code.jquery.com/jquery-1.11.1.js"></script>
language plugins
Hello Forum, I develop a mobile website with jqm 1.3.2 at the moment. The website should work in different languages at the end and I develop my application so, that the strings are in PHP-variables that will come (translated) from the backend. Now, I considered if it is also an option to do the translation with js ion the frontend. I found this solution: https://github.com/coolbloke1324/jquery-lang-js … and ask myself if this solution will work with jqm ore if there are alternatives. has anybody experience
horizontal aligned form elements
Hello forum, I develop a mobile website wit jqm 1.3.2 at the moment. I need some forms with rows of label/form-element-pairs. or in other words: the label has to be at the left and the form-element on the right site. I found "Fieldcontainer groupings" but I want a side-by-side-behaviour up to 320px width. What is the best way, to realize that? Should I use the field container-feature and overwrite it's CSS media queries ? Or should I better use grids? best, heinetz
Mozilla Firefox Release 31.0 and how the jquery ui position method calculates the geometry of the bounding box
I was wondering how the jquery ui position method calculates the geometry of the bounding box for the following html5. def output_text_field(name,fields,size=50): print '<input type="text" name="%s" size="%d" value="%s">' % \ (name,size,fields.get(name,'')) I noticed some difference in the behavior of $('#_test_academic_advisor_name).position( off:'#_academic_advisor_name', my: 'left top', at:'right center') between Mozilla Firefox Version 31.0, which is the current release',
So I have 6 imgs. When a user's mouse is over one of them I want to change the top
When the user's mouse is off the image I want to return the image to its original position, If the user clicks an img I want to change its top position permanently (so long as the user is on the page). Please how would I do this?
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"
Is Iscroll usable to create the same UI as the meetup app?
Hey people. A new man in the app dev. i am developing an app that is inspired in the activity feed UI from the meetup app. The Ui is basically a list of activities with a header (date) that when scrolling up, the header with the new date on it will push the previous header and become fix and so on. I have been searching how this can be possible to do it and found out iscroll plugin but I am not sure if I am right. any advice?
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 ); }
Is it possible that the jquery ui .css property only supports "inline" and "table-cell"?
In jquery-ui.js, I noticed the following code: ------------------------------------------------------------------------------------------------------------------------------- function isFloating(item) { return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display")); } --------------------------------------------------------------------------------------------------------------------------------- Is it possible that the jquery ui .css property only supports
linking to correct section of help file loaded in jquery ui dialog
I have a html help file which I can load in a jquery ui dialog from an anchor tag in a backbone view. Not sure if there is a way to show only the details related to which anchor tag section was clicked. example: help file contains section User Creation User password change In the view if the user click on `User Creation` then i want to launch the jquery ui dialog and show only the `User Creation` details - the user can scroll to other sections if they want to.
Testing with Ajax
I am a newbie to QUnit. I want to test the ValidatePhoneNumber function which has a callback as follows. Would anyone help me to write a test in QUnit for this function? Thanks ValidatePhoneNumber: function (userName, successCallback, errorCallback) { VaultModel.callService(successCallback, errorCallback); } callService: function (successCallback, errorCallback) { $.support.cors = true; $.mobile.allowCrossDomainPages = true; $.ajax({ success: successCallback,
collapsible image jquery
Hello everybody, I want to have a menu with collabpsible image in jquery mobile, is it possible ? Thanks,
In Windows Phone Sqlite Record Insertion is Very Slow
Dear All, I have been developing hybrid application with PhoneGap and jQuery mobile. I'm using PhoneGap sqlite plugin and inserting the above 5000 records in the sqlite database table. In Windows Phone, it's very slow to insert the record in the sqlite table. Please, let me know how to solve the issues. But it's working fine in iOS and Android. Thanks!
Need assistance in getting a jauery plugin working
Hi JAKE, I have got yet another cool jquery pagination plugin, the documentation of which is located at : http://webdesign.tutsplus.com/tutorials/extreme-makeover-jpaginator-css3-edition--webdesign-3620 As usual I need to set the onPageClicked function and cannot figure out how as its different from others : Here is how we are supposed to call it : < script type = "text/javascript" > // Initial call $(document).ready(function(){ $("#pagination").jPaginator({ nbPages:64,
jQuery autocomplete using a local json file?
I am trying to create a jQuery autocomplete widget that uses a local json file. The code for my index page is as follows:- <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Demo</title> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/themes/base/minified/jquery-ui.min.css" type="text/css" /> </head> <body> <p> <label>Address:</label> <input type='text' name='ward' value='' class='auto'> </p> <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
Server abort error in jquery.form.js (while uploading large files)
Hi, I am using jquery plugin in our mvc application. when i try to upload a large file sometimes it works. However sometimes i get an error "server abort" after 10-15 minutes. After examining the plugin i think the error occurs from the below piece of code. I think the readystate got stuck in uninitialized state and the below code causes an exception after few recursive calls. function checkState() { debugger; try { var state = getDoc(io).readyState;
Urdu Text Editor
When we will be having a jqtext editor with multilingual support without using any plugin with them specially for RTL support for arabic and urdu.
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.
javascript datepicker run function with onselect code
Hi, datepicker selected new date and how do I run onselect:"myFFunction" Thanks all sample file = https://yadi.sk/d/NxMDKy05aVxD3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>TÜRKÇE_datepicker example || JsDatePick Javascript</title> <link rel="stylesheet" type="text/css" media="all"
Please let me know where we can find the position bug fix for Google Chrome.
Please let me know where we can find the position bug fix for Google Chrome. ----------------------------------------------------------------------------------------------------------------------------------------- Ticket #6044 (closed bug: duplicate) Opened 4 years ago Last modified 23 months ago position breaks in chrome Reported by: jogep Owned by: Priority: major Milestone: 1.9.0 Component: ui.position Version: 1.8.5 Keywords: position chrome Cc: Blocking: Blocked by: Description ¶ i try
Ammendment to the autocomplete Ui
I have a requirement for the autocomplete input field can this be done: Supposing i have locations like these: Adana Adana Havalimanı Adana İncirlik Adana Merkez Adana Adana, All Adıyaman Adıyaman Havalimanı Adıyaman Merkez Adıyaman Adıyaman , All Amasya Merkez Amasya Amasya, All Ankara Çankaya Ankara Yenimahalle Ankara Ankara So for the above , if i type in Adana it should bring in the four possibilities next to it and similar for others. Can this logic be
Need Help with Mousefollow
Hey Guys! How can I do, that my Mouse move in the Eyes? The Eyes are here; Click and here with the Movefunction. But the Pupils should be in the Eyes, not in the Hover! Thanks!
How to fix Apache server error for jquery-1.11.1.js
We are getting an Apache server error shown below when I try to use jquery-1.11.js in my python javascript program. When I use the following line, I get a Internal Servor Error message in the Google Chrome Browser Inspect Element window. print '<script type="text/javascript" src="https://eecsappsrv.mit.edu/cgi-bin-secure/lib/jquery-1.11.1.js"></script>' However, when I use instead the following line, everything works okay. print '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>'
jquery plugin for listbox ( maybe better a table ? ) compatible with images and or checkboxes
Dear fellow JQers, Im searching for a free of charge open source plugin that lets me create a list box compatible with images... Im searching for a listbox and thats maybe already my first fault as this is just the same as a table. And i think there are more table plugins than listbox cause when searching for the latter i dont get much. Any idea's remarks about this are welcome. I use this listbox to populate it with subscriptions of a user selected in another listbox ( without images ). The subscr
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.
Test if tab is active
I am trying to test when a tab is active. I am not sure if you can do this or not, but I have tried to use .active() as it seemed like it was the only method that might do the trick. However, it does not appear to work the way I had envisioned: if ($('#tabs-4').active('option','active')) I thought this would evaluate to true, however instead it throws an error. Any insight would be appreciated.
Very new to this
Im designing a website though moonfruit and I would like to use the Accordian HTML as it would fit perfectly for what i am doing. The problem is, I cannot seem to change the font or the colour of the text and background, could anyone possibly help. Kind Regards Dave
Newb - jQM not displaying properly in Android 4.3 Default Browser
I'm doing some basic stuff with jQM. I decided to test some code in my android emulator (genymotion) running android 4.3. Once I login to my app, I just get the spinning wheel indicating that there is a jqm page load happening. Everything works as intended in chrome on android on a device, but not in the default browser in the emulator. Is there something special that I am missing in this regard? I have googled and searched with only one result. Any thoughts/suggestions are appreciated. Thanks
Using Datepicker on a Turkish Website
HI, What do i need to change when using the DatePicker for a Turkish website? I need the date to be in format ... dd.mm.yyyy . And if the months can be spelled in Turkish as well its better. Does it offer any possibilities from the above? Thank you
how to append serial number to append fuction
$.ajax({ type: "GET", url: "<?php echo base_url(); ?>bill/product_details", data: {'product_id':product_id,'price':price}, complete: function(json){ re=json.responseText; //alert(re); var obj = jQuery.parseJSON(re); //alert(obj[0].product_id+","+obj[0].price); //var sl=0; //var tmp=JSON.parse(re); $('#main_pro').append('<tr class="trt" id="'+obj[0].product_id+"_"+obj[0].price+'" ><td class="sl">'+cnt+'</td><td class="name">'+obj[0].brand_name+obj[0].category_name+'</td><td><input
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
button-states
Hello Forum, I'm developing a mobile website with jam 1.3.2 at the moment. some pages will get a menu of different functions an I use a fixed bottom navbar with icons. those functions could be simply links to other pages but also functions that toggle the display-state of panels or s.t. else with 2 states "on" and "off" and a would like to use the btw-down and the btw-up states. per default the buttons got the btw-down-class as long as the user taps on it. on release the they lose this class and
Problem with appending serial number
when i remove a row from appended the sl.no seen like 1 2 4 5 3 is removed
Next Page