Acquire attr from selection
In the html file I have several lines similar to: <th class="col-PT" data-ro="yes" data-jhide="no">PT</th> I want to be able to extract the attributes data-ro and data-jhide with a script. In a function I have the following line of code: var $th = $('th'); I get the length of $th and it's correct and I look at $th with the debugger and it an array of 6 th elements. I perform the following: var aa = $th[0]; to get the first element of the array (actually performed within a for loop). My question
Jquery to keep Height of Image / image container to same height height not working
Dear Sir refer http://prajaktasoftware.com/denki/product.php I want to keep the height of image part same this webpage same The jquery has adjusted the height of DIV (class='container1') perfectly for all image on this page this is because .container1 { height: 400px; overflow: hidden; background: #fff; margin: 10px; padding:10px; text-align: center; vertical-align: middle; } However i want name to be aligned properly ...this can happen html <div class="s-12 m-6
Compact way to write multiple selector
Hello, I use jQuery to hide / show table rows. The HTML and CSS code is HTML <ul class="dropdown-menu" role="menu" id="quickSearch"> <li id="all"> <a href="#">All claims</a> </li> <li id="fc"> <a href="#">Field Claim (FC)</a> </li> <li id="zh"> <a href="#">Zero Hours (ZH)</a> </li> ... JS $("#quickSearch li").click(function() {
Can any explain this format in jquery file : !function(a,b) and ;function(a,b)
Hi , I am new developer in Jquery. I can't understand, why jquery use before function this symbol ';' and '!'. For Example : 1. !function (a, b) 2. ;function (a, b)
Magnific popup to open after the page is loaded
Dear Sir I want to open an Image using magnific popup after load of a web page I used code from http://stackoverflow.com/questions/18726419/how-to-load-magnific-popup-on-page-load in web page http://prajaktasoftware.com/learnsharemarket2/indexmf.php It does not work My code <script> (function($) { $(window).load(function () { alert('code to open Magnific Popup after page load'); // retrieved this line of code from http://dimsemenov.com/plugins/magnific-popup/documentation.html#api
jQuery linking with html Problem
Hello, can someone help troubleshoot my code and tell me why the html does not work with the JavaScript? (The JavaScript is game.js) Html: <DOCTYPE.html> <html> <header> </header> <head> <!-- Jquery --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> <script type="text/javascript" src="game.js"></script> <!--- meta data --> <meta charset="utf-8"/>
Pass parameter to a function
I have Jquery var url= "plusproductfill.php"; data = { qty: qty, rate: rate, memberid: memberid, productid: id[1] } $('#value1'+id[1]).load(url,data, mydata(param1 ) ; function mydata(param1) { alert(param1); } In this situation How can i Pass value i want to pass result stored in ('#value1'+id[1]) ... or pass id[1]
beginer's questions
Hi, Sorry for the trivial question. My Dom has body tag and in it I css: image: image-url("appleGreen1.jpg"); I am trying to select the background and apply fadeOut on it Can someone please explain how it iss done? Thanks
How to direct a mobile user to the mobile site and not the full blown site.
I am a total newbie here. I have been writing websites for myself and friends for a number of years, more as a hobby and for no reward. I did a site for a friend who was approached by a company saying that his website was not mobile friendly, and they were correct. For £200 they developed a mobile friendly site probably using jQuery, and it is fine. In order for the mobile site to be seen on a mobile device the mobile design company sent him some code which I inserted in the 'head' of his 'index'
Jquery Leaflet / Geojson
Trying to add a jquery function in to change the iframe url to http://storm.feastspider.com/video.php?stream=feature.properties.cameraname which comes from the json is this possible can someone help me with the code I've made several attempts and cant seem to overcome the hurtle. the jquery code is $("#viewer").attr("src", "newwebpage.html"); I tried to embed on a onclick button in the map window but couldn't make it work there are several different features in the point geojson I've lost some hair
Read the sheet from Spreadsheet
Hi, I working on spread sheet process. I want read and access the spread sheet inside J query. Each spread sheet have different sheet. I need to access the sheet. How get the object of sheet inside JQuery Thanks,
5 stars rating script
I'm writing 5 stars rating script, but hes doesn't work properly, when cursor is on star he changes, but when you go on other star, what previous star is unselecting i need all stars go to select one by one like in normal ratings system. $('.fa-star-o').mouseover(function() { $(this).removeClass('fa-star-o'); $(this).addClass('fa-star'); }).mouseout(function() { $(this).removeClass('fa-star'); $(this).addClass('fa-star-o'); }); <div class="companies-list-item-rating"> <i class="fa fa-star-o"></i>
Alternate way to pass in function
Is this const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});equivalent to const server = http.createServer( function(req, res) {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
Check if multiple select options contain a certain value
Hello, I have a multiple select (id="machApp") and I need to check if the option "other" has been chosen as standalone value OR in addition to other options and, if "yes", do some actions (hide or show an element (id ="machAppSpec")). For a similar task in a single select I use the following code that works fine: $('#machApp').change(function() { if ($(this).val() == 'other') { $("#machAppSpec").show(); } else { $("#machAppSpec").hide(); } }); However this code does not work for multiple
jquery submit form without refresh
Hi, I need help ! In my code i send some data to the server and get html data back. <script type="text/javascript"> $(document).ready(function() { $(document).on('submit', '#qu-form', function() { var data = $(this).serialize() + '&cmgroup=<? echo $_SESSION['category'] ?>' + '&type=Question';
Drag and Drop But After page Reload Table Takes Its original Position back.Plz help me
Dear sir, My Code is //----JavaScript Function For Second Div which are Drag Table From One Div(source) to another Div(Targate) <script> function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("text", ev.target.id); } function drop(ev) { ev.preventDefault(); var data = ev.dataTransfer.getData("text"); ev.target.appendChild(document.getElementById(data)); } </script> <body> <form id="form1" runat="server"> <div id="content_dv1" runat="server">
Need help finding right plug in
I am a total noob designer working in dreamweaver cs5. I am designing a website for my business. I am down to the last page i need to set up and cannot find what i need exactly, and do not have the knowledge to adapt something quickly. I need to make a thumbnail grid with icons that have links to them. Currently i was just doing it in html code by putting each one on at a time and linking it. I have them in rows of 12 and then each row has its own css rule. I need to place over 800 of them. So it
How to autocomplete a field depending on a list of checkboxes?
Hi guys! I have a pure js code that allows to autocomplete a field depending on a checkboxes list, but this code doesn't work on IE < 9. Pure JS I want to make the same thing but using jQuery to avoid IE verions issues, I am a newbie, so I don't know exactly how to do it. I found a code but I don't know how to apply it on my DOM. This is my code without jQuery, can any body here help me, I'm really LOST :( Thank you in advance.
Auto complete dynamically generated text boxes
I need help in filling the dynamically generated text boxes using jquery autocomplete. Workflow: 1.On clicking add row button a row will be inserted. 2.On the inserted row,the product text box should be filled through auto complete.The same way all the dynamically generated text boxes should be filled by auto complete Issue: I have used the jquery auto complete function to fill the text boxes,but the auto complete function is working only for the text box in the first row.I need to fill all the dynamically
jquery conflite problem
Hi this is Ravi, am using jquery.1.8.3.js for tab navigation and also using jquery-2.1.4.js for bootstrap toggle button. There is a problem here if i use jquery-2.1.4.js, the remains tab navigation is not working, because higher version jquery is used. i want to use both jquery-2.1.4.js and jquery.1.8.3.js. please give me solution. how to use the noconflite() method
adding floats
why is it like that: 0.1 + 0.2 == 0.30000000000000004
text() method no longer works after loading a text file
alert returns nothing. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <div id='first'></div> <p></p> <div id='second'></div> <script> $("#first").load("Matthew1.txt").css("white-space", "pre-line"); var result=$("#first").text(); alert(result); </script> It seems $("#first").text() doesn't work after the load().
Passing a variable to function that calls load()
Trying to pass res from input form to doIt(). <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <input> <div id="search">search</div> <div id='first'></div> <p></p> <div id='second'></div> <script> var res; $("#search").click( function() { res=$("input").val(); alert(res); doIt(); } ); function doIt() { $('#first').load("Matthew1.txt", function(data,status) { var myArray; // I want to set this to the value in input form. //var res=/\d+\s.*Jacob.*[.;:,]/g;
jquerymobile: main (unrecognized role value)
I am a new starter to jQuery and I was just following a tutorial on YouTube using DW CS5.5 and I came across an error, 'jquerymobile: main (unrecognized role value)'. The tutorial is here: https://www.youtube.com/watch?v=bsthKhTHguI Take it to 2 minutes 52 seconds. I have double checked what I have typed and cannot see an error, but using DW in 'split screen mode' it shows the 'jquerymobile: main (unrecognized role value)' as an error. Any ideas please?
Control function arguments
function A(a) { ... } A(undefinedVar); results in error. how i control function argument to prevent undefined arguments input ?
Keeping slidetoggle div pinned to bottom of page
I've been hung up on this issue for quite a bit and after searching many different questions unsuccessfully hopefully someone can aid me a bit. I'm using jquery slidetoggle to open a small window when a user clicks on a tab that should always be pinned to the bottom of my site. My issue is that when I have multiple tabs together at the bottom and one is clicked, then both rise to the top of the div. I want them to move independently so when one is clicked the other stays pinned to the bottom of my
Code changes don't take effect
Hello, I have the same template on two websites (WordPress). I downloaded a Custom Javascript plugin and added the following code: Code: $("#wrapfirst").removeClass("fadeInUp pagewrap1");
$("#wrapsecond").removeClass("fadeInLeft pagewrap2");One website applied the changes and the other didn't. The one that did is www.shawneegaragedoors.com and the one that didn't (still has fadein effects) is www.madisongaragerepair.com I also tried a different thing that worked on the Shawnee website but not on
Error(uncaught exception: out of memory) when I do a Ajax Call and Form Post inside JS
I understand there is a solution in jquery to use event.preventdefault but I'm constrained with the limitation I have with the current structure. There is an onclick link that calls the "selectQuery" function and then it goes through the Ajax before posting. If I comment out "f.post", the ajax runs smoothly otherwise it throws an error:out of memory Is there a hack or workaround, I can use inside SelectQuery method where it will work similar to event.preventdefault. I tried return false; that didn't
show, hide, background image help
hello, i'm newbie in JQ i created a show and hide button to open and close div, i used "simple" code i found on http://papermashup.com/simple-jquery-showhide-div/ the code working perfectly on my site, but after i click on my botton i want to change the "background image" i have 2 images, for "show" plus.png and for "hide" minus.png the original code: works perfect: jQuery(document).ready(function(){ jQuery(".slidingDiv").hide(); jQuery(".show_hide").show(); jQuery('.show_hide').click(function(){
using function
i want to run a function like "message" : message( function ( ui ) { ui.box.addClass("msg1"); }); the message function performs the following: 1. var box = $("<div>message</div>").appendTo($("body")); 2. points to box with ui.box how is the behind code ? how do i make the ui.box part ? :/
Folder access using javascript
Hello, Here is my question:- I have a "Plan" folder having "Index.html" page. On Index.html page, I want to display images from "images" folder in same directory automatically by reading the filename from images folder without specifying the folder pathname in img tag. I am not able to access images folder. Is it possible in jquery or javascript??? Kindly help. Thanks in advance. Regards, Nikita Kotian
Using selector
I am trying to get all of the form elements. I am successful with this: $("input, select").each(function(){ I am worried that if I add another form though, that this will pull those fields from that form as well. I tried adding "#form" and "form" to the front (of each), as well as putting ":" in front of input/select, but it only pulls the input fields then.
Loop through class with if statement
Hi all, I have multiple divs with class .repository_image all containing an image. I need to loop through them and assign the class .portrait if it contains an image that is in portrait orientation. I tried the following but it did not work :( $('.repository_image').each(function(){ if($(this).width() < $(this).height()){ $(this).addClass("portrait"); } }); What am I doing wrong?
.slideDown Help
<style type="text/css"> body { margin: 0; } ul { list-style-type: none; margin: 0; padding: 0; width: 25%; background-color: #f1f1f1; position: fixed; height: 100%; overflow: auto; } li { display: block; color: #000; padding: 0px 0 0px 0px; text-decoration: none; } .submenu1 { display: none; } .submenu2 { display: none; } .submenu3 { display: none; } .submenu4 { display: none; } </style> <script> </script> </head> <body> <ul id="Menu"> <li><img
download an old version of a theme
Hi, i need change a theme that i use in my web. I used a theme named cupertino in version 1.8.18. Now i need change it to use other edited but i can´t download the version 1.8.18 of my new theme, i only can download in version 1.9 or higgest... can somebody help me? i don´t want change every code, i want use the same but with a new theme wich i've edited. Thank you. Sorry for my english :)
Bit confused by how JavaScript/JQuery executes code?
I'm a C++ programmer, and I'm watching some tutorials on JS/JQ and I'm having trouble understanding something (something no one seems to explain). Where is the executor in JS/JQ? In C++, code is executed in an ordered fashion, staring at main, and flowing from top to bottom, and finishing at the end of the main function. With JS/JQ it seems almost mysterious. If I have a .ready() function, does it execute it once, or does it keep looping? If it only executes it once, then how is it possible that
how does
Olá, boa tarde, eu sou novo para jquary e eu estou tendo problemas para escrever este algem código poderia me ajudar.
1 - Criar 3 botões;
2 - usando jQuery mudar a cor dos botões na página de formulário de inicialização que o botão deve ser de 1 vermelho, 2 botão deve ser azul e o botão 3 deve estar verde.
3 - clicando nos botões 1, 2 e 3 deve ser na cor roxa;
4 - clicando nos 2 botões 1 e 3 deve ser na cor amarela;
5 - clicando nos 3 botões 1 e 2 deve ser na cor cinza;
criar um quarto botão
my global variable wont work
//when i console array variable row in the second click handler its displayed as undefined. $(document).ready(function(){ var row = []; $('tr').click(function(){ $tds = $(this).find("td"); // Finds all children <td> elements $.each($tds, function(index) { // Visits every single <td> element row[index] = $(this).text(); });//
What a best practice way to organize (what directory structure) the jquery mobile .css files, html files etc in a macBook Pro environment?
For a hobby, I’m trying to develop a mobile app solution for my uncle’s small business. I have a lot of programming experience, but no web development experience. I’ve got a mysql database designed, implemented and populated. I just have no idea who how to organize the downloaded jquery mobile css files, the jquery core files, Node.js, Express, ... or the html files to be created later. Help!
looping a variable with dynamic incremental number
Hi guys! I'm looking for a way to just use one row for variables.. This stuff works, but I guess I should write this more effective? var H1 = moment.unix(data.hourly.data[0].time).format("HH");
var H2 = moment.unix(data.hourly.data[1].time).format("HH");
var H3 = moment.unix(data.hourly.data[2].time).format("HH");
var H4 = moment.unix(data.hourly.data[3].time).format("HH");
var H5 = moment.unix(data.hourly.data[4].time).format("HH") what I want is
Next Page