Slider with another slider isnide
Hi there Can anyone help me with this? How can I add slider inside slider. I whant normal big slider and in the bottom of this slider I whant creat brand carousel. Is there any library for it? Or simply I creat two separate sliders and using css I add position to this first one?
Best way to disallow functions on table cells with class="xyz"?
I have a table where I want to allow inline editing for all td elements except those having class="noedit". The following appears to work and only adds the background color to those cells which should be editable. I wonder if there is a better way to do this? I'm pretty new to the :not and :has selectors. <table> <caption>Edit-y Table </caption> <tr> <td class="noedit">Can't edit me<td> <td>But you can edit me</td> </tr> <tr> <td class="noedit">Can't edit me<td> <td>But
Detect if elements enter viewport from top or bottom
Hey guys, Is there a way to detect (onscroll) wether a div-container enters the viewport from below or from above, and then do something as long as the div remains in the viewport (in relation to scrolling-direction). Thank you very much Tobi
Making an IMG unselectable, IE9 compatible
I've discovered that the non-standard CSS to make something unselectable doesn't work in IE9: .unselectable, [data-em] { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: -moz-none; -ms-user-select: none; user-select: none; -webkit-tap-highlight-color: rgba(0,0,0,0); } When a user inserts an emoji to my contenteditable, I don't want them to be able to click on it and drag to change the size... backspacing
How to call ajax links out of ajax content
The following scripts are encapsulate within "$(document).ready(function()" Script No. 1: $("#incoming_entry").on("click", function(){ $(this).incoming_entry(); }); $.fn.incoming_entry = function() { $.ajax({url: "./query/incoming_incoming.php", success: function(result){ $("#incoming_content").html(result); }}); }; Via click on an a-element with the ID incoming_entry this script
How to customize jquery to minimize the size
Hi, I am trying to use jquery in an embedded software project. We are using Micrium RTOS operating system and their HTTP Web Server implementation. As it is embedded software they offer so called static file system (*.html, *.css etc compiled and converted to string literal using #define – see below) and dynamic file system (mounting SD or USB card as a system drive from which files are red). I was told (our local architectural decision) I have to use static files – which basically means that every
Weirdness displaying radio button after form submissions
After submitting a form, we're displaying all the form field data, but for some reason, everything after the radio button will not display on the page. var display = "<h4>Client room</h4>" + $("#firstName").val() + " " + $("#lastName").val() + " " + "<br>" + $("#emailAddress").val() + " " + "<br>" + "Sample 1: " + $("#q1").val() + "<br>" + "Sample 2 " + $("#q2").val() + "<br>" + "Existing: " + document.getElementById("q3").value;
Display form submission data with same-page thank you message
How can we display form submission data in a "thank you" div using only jQuery? There's no URL refresh.
Can't find mistake, but surely some of you...
Dear all, I am using Chronoforms on Joomla and would like to add a JQuery custom code. Since Joomla moved from Mootools to JQuery, I have difficulties migrating the following code. Here's what it does: In short, to register for a debate tournament, field values #debaters, #judges, #observers are multiplied (by a fee) and added together. The tricky part: there is a discount option for every judge you bring more than the number of teams. Now, the number value of teams itself (capped at three) is irrelevant
Unable to select just one checkbox
<input type="checkbox" name="q_4[]" value="scales" /> <input type="checkbox" name="q_4[]" value="horns" /> <input type="checkbox" name="q_4[]" value="claws" /> key = "q_4[]"; value="horns"; $('[name="' + key + '"]' + '[value="' + value + '"]').prop("checked", true); Thank you
How to reach this element using jquery?
Hi, I am able to get the attached return using: console.log(data.e); but I want to know how can I reach the response element to read the document_id? I tried: console.log(data.e.response.document_id); but it's not working.. Thanks, Jassim
jQuery event variable scopes and ES6 classes (JSFiddle)
I'm having some issues getting a class method to fire when events are triggered. JSFiddle Basically, for buttons #1 and #2, you get the alert, but the _selector property is undefined, so obviously the event triggers fine, but it cant see the _selector property.. But for button #3, all thats really changed, is the btnThree.eventHandler(); gets executed from within an anonymous function... But it works just fine. Any ideas? I'm sure it's something simple.
I can't get the h1 in the jumbotron to execute the jquery function. Is something wrong with my code?
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Twilight Talk - Twilight Zone Blog</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <link href="web-fonts-with-css/css/fontawesome-all.min.css" rel="stylesheet"> <link href="css/twilightzone.css"
How can i pass multiple values of fropdowns in url?
Hey guys, I'm currently creating a project with Codeigniter and i have some dropdowns which will filter my db results using "GET" method in url. What i want is to pass or replace (if its already in the url) the value of the selected dropdowns ONLY, like an array. A guy helped me on some point but on selecting another dropdown box the value in url is replaced with the last chosen. Could you please help me on that?! P.S.: If you faced the same (filtering results) and you have a different proposal
Having Issue on Mouse Hover Between Two Element
Can you please take a look at This Demo and let me know how I can keep the #panel slide down/open when mouse traveling/hovering between #flip and #panel? and only slide up when mouse is out of theses two? $(document).ready(function() { $("#flip").hover(function() { $("#panel").slideDown("slow"); }, function() {}); $("#panel").hover(function() { }, function() { $(this).slideUp("slow"); }); }); body { padding-top: 20px; } #panel, #flip { padding: 5px; text-align: center; background-color: #e5eecc;
Unable to get input type
<select name="q_1[]" multiple size="6"> <option value="1">Volvo</option> <option value="2">Saab</option> <option value="3">Mercedes</option> <option value="4">Audi</option> </select> <select name="q_2"> <option value="1">Volvo</option> <option value="2">Saab</option> <option value="3">Mercedes</option> <option value="4">Audi</option> </select> <input type="checkbox" name="q_4[]" value="scales" />Scales <br /> //DOES NOT WORK ---ALWAYS GET undefined el = $('[name="q_1[]"]');
zabbix jQuery working on localhost but not remotely
Hi, I am using zabbix3.0.20 with apache server. When I access the webpage from localhost it loads fine but when I access the webpage remotely from another machine over the internet the page loads very slowly and incompletely. I get the following errors Uncaught ReferenceError: jQuery is not defined errors. How can I troubleshoot and fix this? Thanks Reagards, Usman
Hide div based on minimum number checkboxes selected
I wan to show hide divs based on total number of checkboxes selected in the html below. I want to .. 1. Hide div.cart if total no. of checkboxes selected is less than 3 and show div.notice 2. If total no. of boxes selected is greater than 3 hide div.notice and show div.cart. To sum if up div.cart show only be visible if user has checked 3 or more boxes, if not than user can only see div.notice telling them to select more. <input type="checkbox"> <input type="checkbox"> <input type="checkbox"> <input
$.on('keydown mousedown',...), force caret to the end of the node
Inside of a contenteditable, say that the caret is inside of a specific node (in my case, <q data-em="1"></q> ). How can I immediately kick the caret outside of the node, past the ending tag? I'm using the same loop that Jake helped me build in another thread to find when they're within the Q element: $('[data-ce]').on('click keydown', function(e) { var node = getSelection().anchorNode.parentNode; while (node && node.hasAttribute && !node.hasAttribute('contenteditable')) { console.log(node.nodeName);
How to prevent form submit for href within a form?
Hi, I have this form: <form id="FormSignin" name="FormSignin" class="login" autocomplete="off"> <h1 class="login-title">مركز الإمام الصادق عليه السلام</h1> <input id="email" name="email" type="email" class="login-input" placeholder="البريد الإلكتروني" autofocus autocomplete="off" required="true"> <input id="password" name="password" type="password" class="login-input" placeholder="كلمة السر" autocomplete="off" required="true"> <img id="ImageSigninLoading" src="images/loading.gif"
How to append data to bootstrap data table?
I am getting the data to display but the table says "No data available in table" then it displays the database data and it does not allow me to do any of the built in features that come with the bootstrap data table like sort columns of pagination. Here is my code: <div class="table-responsive"> <table id="datable_1" class="table table-hover display pb-30" > <thead> <tr> <th>Product</th> <th>Variation</th> <th>Department</th> <th>Category</th> <th>Air/Boat</th> </tr> </thead> <tbody> </tbody> <script
Jquery selector on Django loop
So I have this It looks like this: https://gyazo.com/0b329d87af9372250a53ae25347b59b0 I need to select the items name when the user clicks on the anadir_button. Something like $('.producto_precio').last()clone().appendTo('#list_pedidos'); But this one just selects almendras, bananas and bolson frutal {% for producto in reparto_martes %} <div class="col-md-3"> <div class="card mb-4 box-shadow product-box"> <img class="card-img-top product-photo" data-src="holder.js/100px225?theme=thumb&bg=55595c&fg=eceeef&text=Thumbnail"
CHelp to create JSON
Dear Sir/Madam I came as across https://codepen.io/prajaktasoftware/pen/yqqgrV My difficulty is to stored the changed data in database so that changes can be stored and retrieved pl help how can i do it
$.ajax('s done not called
Hi, I have below simple ajax call to post a form. the form is being successfully posted and data were saved to the database but the problem here is my done is never been invoked and i am not getting the console.log("done") nor the rest of the done code. where is the issue here please? $.ajax({ method: "POST", url: "save_student.php", data: $("#frmNewStudent").serialize(), dataType: "JSON", beforeSend: function() { $("#ButtonSaveNewStudent").hide(); $("#ImageLoading").show(); } }).done(function(data)
Upload File & Data Problem
I'm using FilePond & it passes the file to you in a function. I'm trying to do a simple file upload w/ additional upload data. Here's my js: function fpUpload(fieldName, file, metadata, load, error, progress, abort) { console.log('InsideFP-Upload: ' , upload); // set further up console.log('InsideFP-File: ' , file); var obj_data = {}; obj_data['upload'] = upload; obj_data['myfile'] = file; var imgData = new FormData(); $.each(obj_data,
Why don't work button???
$(document).ready(function() { $("#createStudentForm").unbind('submit').bind('submit', function() { var form = $(this); var formData = new FormData($(this)[0]); var url = form.attr('action'); var type = form.attr('method'); $.ajax({ url : url, type : type, data: formData, dataType: 'json', cache: false, contentType: false, processData:
Test if class exists on the site
Is there a way to check if a class that's assigned to something is actually defined on the site? I'm specifically working with content posted into a contenteditable. If they copied from my site then I want to keep the classes, but if they copied from another site and are bringing over classes from that site, then I want to remove them.
$(event.target) works on click, but not keydown... alternative?
I have this script working just fine when I click on it using the mouse, but it doesn't trigger the while() loop if I move to it using arrows: $('[data-ce]') .on('keydown click', function(e) { var node = $(e.target); while (node.is('contenteditable') !== 'true') { alert('node - ' + node[0].nodeName); alert('this - ' + this.nodeName); if (node[0].nodeName == 'B' && !$('[data-richcont="B"]').hasClass('richbuttonOn')) $('[data-richcont="B"]').removeClass('richbuttonOff').addClass('richbuttonOn');
jQuery addClass to all img
Hi. I'm having some issue on FAQ page. The basic FAQ is the dropdown image doesn't have any class or id. We want when user click the question it toggle open and i'm using jQuery to add some class on the image. But the issue is it add the class on all the image question, not only current toggle question. How can i achieve this? Can someone guide me. Here is the script that i'm working for. {source} <script type="text/javascript"> jQuery(document).ready(function(){ jQuery("a").click(function(){
How to read a text box value and copy it to another one?
Hi, I have a List View and above it, there is a filter... The filter is any text entered by the user... How can I copy the value the user enters in that box and copy it to a another box? The background is I;m using K2, we have a listview, above it is a Built-in feature to filter results, we want to capture what the use types in that filter and then use the value to trigger a report using that filter value. At the moment, we can't do anything with that filter value, so hoping jquery can somehow copy
Put <td> below <th> having similar values
Hi folks, Actually I have a table organized in this way : CompanyName | Red | Blue | Yellow company1 Blue Yellow Red And I would like to dynamically put similar elements bellow <th> having the same value CompanyName | Red | Blue | Yellow company1 Red Blue Yellow Many thanks for any help in these regards. Below is my try.. but doesn't seem to be successful var headers = []; var row = []; $("#dashboard > thead > tr > th").each(function(k,v){ var header = cleanHeader($(this).text()); $("#dashboard >
How can i repeat a SVG animation with Jquery ?
Hi, How can i repeat a svg animation with jquery loop ? So that each time i can give different color to the draw line. Below is my code. This is the fiddle, https://jsfiddle.net/Lsau2h4t/2/ The aim is i want to draw the line with different colors each time one color, Eg: First red, Second repeat green, third repeat yellow etc.. How can i do it ? Thanks in advance.
Is it faster to use .hasClass() before removing classes, or just go ahead and remove it?
I'm not quite sure how to test this for myself, but I'm thinking this might be a rookie question, anyway. Is it generally faster to test if an element has a class assigned to it before removing it? Or is that just doubling down on the processing time whether it's true or false, in which case it would be faster to just remove it without testing? if ($('[data-richcont]').hasClass('on')) $('[data-richcont]').removeClass('on'); And does the same stay true if I use removeClass('on').addClass('off')?
Reorder numbers in string
I have a string with numbers: 10 9 8 11 I need to reorder them so they are in order like this: 8 9 10 11 So I'm using this function: strToAppend = strToAppend.split(' '); strToAppend.sort(function (a, b) { if (isNaN(a) || isNaN(b)) { return a > b ? 1 : -1; } return a - b; }); That works but the problem is that the string comes out like this: 891011 How can I reorder and still keep the
Found out selected tab
I'm using tabs like this: https://jqueryui.com/tabs/ I need to perform different tasks depending on which tab is selected. How can I check which one is selected?
Best way to concatenate two URL parameters into one hidden field
How can I concatenate two URL parameters into one hidden field? For example: sometestingurl.com?color=yellow&thingy=box We'd like "yellow-box" to pass in the hidden field, "finalProd". $('a[href^="http"]').each(function() { var $a = $(this), q = $a.attr('href') ? $a.attr('href').indexOf('?') : -1, contents = $a.html(); if (q == -1) { $a.attr('href', $a.attr('href') + '?color=' + App.getParameterByName('color') + '&thingy=' + App.getParameterByName('thingy'));
adding a hash to URL in order to access unique content in the page
I have a page build with products that when clicked a panel above shows a content related to the product. this is my sloppy code to accomplish it $(document).ready(function(){ $( ".tab-1-th" ).on( "click", function() { $('.hdr-tab').hide().removeClass("active in"); $('#tabs-1').fadeIn(); }); $( ".tab-2-th" ).on( "click", function() { $('.hdr-tab').hide().removeClass("active in"); $('#tabs-2').fadeIn(); }); $( ".tab-3-th" ).on( "click", function() { $('.hdr-tab').hide().removeClass("active
How to pass URL parameter to form submission
What's the best way to pass a URL parameter to a form submission? For example, in the following URL, we'd like to pass 'cid' and 'eid': domainname.com?cid=12623&eid=fwa3
Does the php interpreter get confused when there's a defined FORM submitted to x.php, but also an Ajax call to y.php?
Hi, I'm working with some code that has a standard FORM and Submit button, with the associated x.php to process the fields. But there's also Javascript that refers to a certain section on that form, but which has an Ajax() $_POST call to another url y.php. Is that proper? Since this is essentially a Submit (I think) to one form inside another form with a different submit module, is that considered a nested form? I don't even know if nested forms are ok in php, to begin with, aside from the javascript.
Reorder list elements (by code, not mouse)
I have a list with values and the order from start is a bit random and differs from time to time: <ul> <li>2</li> <li>10</li> <li>5</li> <li>7</li> <li>6</li> <li>8</li> <li>9</li> <li>4</li> <li>1</li> <li>3</li> </ul> How do I reorder the list so that 1, 3, 6 and 7 always ends up first? Also the order of the rest of the elements needs to be preserved. So the result would be: <ul> <li>1</li> <li>3</li> <li>6</li> <li>7</li>
Next Page