Add two diffrent Products in Cart with jQuery in WooCommerce
Hey everyone,im trying to add multiple products with just one Click to my WooCommerce Cart. This is my actually code: jQuery("#button").click(function(e){ e.preventDefault(); addToCart(28,29,"Red"); return false; }); function addToCart(p_id,v_id,a_name) { jQuery.get('/wp/?post_type=product&add-to-cart='+p_id+'&variation_id='+v_id+'&attribute_color='+a_name, function() { }); } At least im able to add one product, but i would like to add some more of the addToCart()-Functions like:
How to close menu when clicking on page whitespace?
Hello, I have a custom menu that a few nice people helped me build to hold all the admin links for the BBPress plugin for WordPress. Currently, if you click the Options button, it will open, click it again, it will close. I would like to add some additional jQuery to make it close when a user selects a place outside of the menu container/page whitespace. Here is my code. /*Custom BBPress admin links menu*/ function wpmudev_bbp_admin_links_in_menu($retval, $r, $args) { if ( is_user_logged_in()
Image Search from Dropdown, and Highlight Corresponding Image(s) Based on id
Hi, Does anyone have an idea on how to do the jQuery for the gif image I've attached? Essentially, you select from the dropdown and the image(s) with the corresponding id go from being faded out to faded in. Thanks!
Swap values in an array
How can I write this in a concise way? Basically, I would like the values in 'middleArray' to change base on the value of the variable 'multiplier'. 'multiplier' is determined by the user and will have a value between 2 and 5 inclusive, so if the user selects say '3' then I need the values in the array to change/be updated accordingly. I've looked at the .map() functionality but am not really sure how to apply it in this instance or if it even is the right approach! if(multiplier == 2) { var
How to toggle display of select
Hello I have two drop downs in my app. Initially second drop down box is empty. Based on the selection from first select, then second select is populated dynamically. I came across this posting jQuery Mobile displays hidden select element As per this posting I was able to hide the second select initially using the ui-screen-hidden is a jquery mobile defined class. But how do I set display:block when it is populated? Joe
Do a series of fade-in, fade-outs (but execute serially)
Hi all, Basically, I am calling a function in a for-loop. That function fades in and out some elements on the DOM. However, the for-loop keeps advancing up to its maximum before the animations in my function are done. How can I tell my for-loop to wait until the first function call is done before advancing to the next iteration? Cheers.
Delete file
Hi I am using this tutorial to load file to the server: http://tutorialzine.com/2011/09/html5-file-upload-jquery-php/#comment-602456 But now i need delete the file when the user make clic in the file is already load. I mean: when i load the file, it apper with the green ckeck, to say is already load, well now i need when i make clic in this image, delete the file from the folder and from the div too. Sorry for my poor english.
Responsive menu: toggle adds inline styles
I am trying to create a simple responsive hamburger menu type: http://codepen.io/bg17aw/pen/yOzvpE However, since toggle adds inline styles of "display:none" this creates an issue where each time I re-size to mobile view (less than 768px) and press on the hamburger twice (once to show the menu, once to hide it), then re-size viewport to desktop view (above 768px), the navigation remains hidden because of the inline styles. The exact same issue is described here: https://css-tricks.com/forums/topic/issue-with-jquery-slidetoggle-display-none/
Set Time Picker to mili second
I have following code to set my timepicker to the current time, but it only gets second. I would like to know are there any way to get to millisecond like 10:44:05.123 $('#dtpime').timepicker('setTime', new Date()); Your information and help is great appreciated, Sourises
Making menu width moving marks(small red triangle)
I want to make clicked menu arrow(width :after), but i want only one who is clicked turns into toggleclass(menuarrow1) and all other back to : after How to make this? $(document).ready(function(){ $('.myMenu ul li.has-children > a').click(function() { $(this).parent().siblings().find('ul').slideUp(); $(this).next('ul').stop(true, false, true).slideToggle(); $(this).toggleClass('menuarrow1'); return false; }); }); http://codepen.io/psairidas/pen/wGpxgq P.S.
verify facebook profile link
I am struggling to verify a facebook profile link with jquery. Users need to fill in the whole url of their FB profile link, not just the username. And multiple options are allowed. https://facebook.com/somename/ => true (with or without the last / and optional www) https://facebook.com/pages/ => false (with or without the last / and optional www) https://facebook.com/pages/somename => true (with or without the last / and optional www) https://facebook.com/ => false (with or without the last
know if a css class exists in document
Hi, i'm looking for know if a css class name exists in document, not get elements by class name. Is there a way to do that? Best Regards Maximiliano from Uruguay
jQuery-UI .sortable plugin does not work on Microsoft Edge browser
The jQuery-UI .sortable plugin works in IE (as well as Chrome & Firefox), but doesn't work in the Edge browser. Is there a fix? Here is example code that works on "everything" except Edge: <!DOCTYPE html> <head> <title>jQuery UI Sortable - Example</title> <link href="http://code.jquery.com/ui/1.11.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet"> <script src="http://code.jquery.com/jquery-2.2.3.js"></script> <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
"data-filter" attribute in "collapsible-set" (version 1.2.1)
Hi all ! I would like to know if it possible to have a data-filter" attribute to a "collapsible-set" in version 1.2.1 of jquery mobile ? It doesn't run in my code (an extract code) <div data-role="content" data-theme="b"> <div data-role="collapsible-set" data-filter="true" data-filter-placeholder="Search a car :"> <div data-role="collapsible" data-iconpos="right" data-collapsed-icon="arrow-r" data-expanded-icon="arrow-d" data-filtertext="honda"> <h3>HONDA</h3> <p>model
Re-attach CSS to dropped draggable div
I have a bunch of divs which are 'draggable': HTML <div id="a1" class="answerCard noselect">1</div> <div id="a2" class="answerCard noselect">2</div> <div id="a3" class="answerCard noselect">3</div> <div id="a4" class="answerCard noselect">4</div> <div id="a5" class="answerCard noselect">5</div> CSS .answerCard { position: absolute; top: 0px; left: 0px; width: 150px; height: 150px; font-size: 120px; font-weight: 700; color: #fff; text-align:
If input has a value, hide label
Hi, I'm trying to achieve that if an input-box has a value it's label should hide. Please have a look at my example on CodePen: If input has a value, hide it's label The part which is not working is this: if ($(this).val() !='') { $(this).closest('.form-label').hide(); } What is wrong with my code? Thanks
Show/Hide Tooltips on Button Toggle
Is there a way to show/hide 'all' tooltips on a button click rather than a mouseover of individual divs? On the fiddle, a mouseover each box reveals the tooltip for that box, I want to be able to disable the tooltips being shown on a mouseover but enable them to all show on a mouse click of the button, which can be toggled to then hide all tooltips when clicked again. NB: Unsure why the tooltips aren't hovering over their associated divs on the fiddle, all working fine in my actual code. jsfiddle
JQuery UI Select Box BREAKS Inside Absolutely Positioned Divs?
Anyone know why JQuery UI's Select Box Breaks when put inside a div that's had it's positioning changed from the default static value? https://jsfiddle.net/SkepaWeb/nap04mLa
Sortable issues - insert area doesn't show and dragging item drags list
I have a list that works fine using everything except IE 11. A user trying to drag an item into a list doesn't get the insert area and when trying to move an item in the list to a new location, the entire list drags (see screenshot). The "Do you have a symptom..." item is being dragged, but the entire "General Heart Failure..." list is moving. Since I'm new to jquery and I can't recreate the issue, I'm a bit lost as to how to resolve the problem. Edit: here's the relevant script: <td valign="top"
Datepicker calendar displayed on top of the screen for a scrolling window
Datepicker calendar is displayed on top of the screen rather than the being displayed next to the text box. The issue seems to be on a scrolling window, on a non scrolling window it is working fine. I have attached a screen shot below. Any ideas how to solve this please. I am using the default "jquery-ui.css"
navigating links invalidates UI when using jquerymobile's collapsible
Not sure if it's a known issue, but I noticed that pages that use jquerymobile's collapsible cause other pages to be rendered incorrectly. What's more surprising is that this behavior is consistent across different browsers, on top of that I noticed lots of other weird issues with pages that use collapsible from jquerymobile. As a side note: I use in my page jquerymobile only because of collapsible, but most likely it's not an issue of collapsible, but of jquerymobile instead. Here's how it happens:
Why is script looking for theme files sometimes at mysite.com/mysite.com/src.gif?
See screenshot below. http://localhost:6835/skin/%22http://etcetc... This is not from my code -- it's from jqui:
Carousel Slider Background & reflection.js
Hey! I am using this jquery 3d slider for my website: http://www.jqueryscript.net/rotator/Minimal-3D-Perspective-Carousel-with-jQuery-CSS3-3D-Carousel.html It's perfectly working but occupies the whole backgroundpicture. I would like the slider to have a transparent background or have a individual image as background. Does someone know where and how I can do that? additional question: I use this reflection.js: http://www.digitalia.be/software/reflectionjs-for-jquery/ And would like to add some distance
Popups don't open on wanted position if user scrolls down
Hi, I spent all day on this and it's driving me crazy... I have two popups. The first one is in the footer : I want the popup to open at the same position as the footer. It works if you don't scroll. If you scroll the popup will open every time on the original position of the footer. How can I update the correct coordinates to the popup position ? Then I have dynamic popups that are created whit a javascript function. Now this is even worse. It's fine as long as you don't scroll, but if you scroll
Browser back button detect and reaload
Hi I need to check the action browser back and forward. If one of them clicked. reload the page either with the confirmation or without confirmation . Pls help
jQuery conflict Uncaught TypeError
Hi, I created on my frontpage a row with icons, when you click on the icons you will see more information about the subject. But the problem is now after creating this script that it doesn't work very well. I get the following error in my inspector: Uncaught TypeError: $(...).visible is not a function Uncaught TypeError: $(...).loadPage is not a function(anonymous function) Could anyone explain what's missing in this script? I've tried to add the no-conflict mode in jQuery but I can't get it working.
Having trouble assigning hyperlinks to .gifs that become visible through .toggle
Hi everyone, new to jquery and the forum and even quite inexperienced with html. So, I have this code: <head> <title>Title</title> <meta http-equiv="Content-Type" content="text /html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" href="mystyle.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $('p a img').each(function(){var path = $(this).attr('src').slice(0,-4);
Can't display ajax call return
Hey guys, first time posting here and I'm rather new to web programming. This is a pretty mundane question ( I've tried many other place but no one seems to want to help / direct me in the right direction). Here's the thing I have an ajax call that is sent to a controller file ( I'm using Yii MVC) and I've tried a million thing but nothing is returning Ajax call: $('#validate').on('click',function(){ var data = []; // data container // collect all the checked checkboxes
Replacing the dragged element (or drop on self)
Hi guys, I have some elements that are both draggable and droppable, but I can't drop an element on "itself", which I need to be able to do. I have made a simple test scenario here: http://master.siteloom.dk/files/test/draggable.php I just paint the background pink on the "over" event, and I need the dragged div to become pink as well (so I know it wil lbe accepted). I have search almost everywhere, but even though accept is '*' or a function that always returns true, I can't get it to work :(
Jquery PJAX full blown function
I'm trying to build a function that can be built upon for ___X___ (generic) with PJAX, and was wondering how exactly I can finish building it out this is the github function: var pjax_e=0; function swapContent(href, url_data, target, loads) { $.ajax({ type: 'GET', cache: false, url: href+'?' + url_data, //add a variable to the URL that will carry the value in your i counter through to the PHP page so it know's if this is new or additional data success: function (data) { // this param name was confusing,
DatePicker beforeShowDay Fuction not working
Hello, this is my first post or question. I am working on a website. I have a datepicker input and should disable some dates. Here is my code: var disabled_Days = ["4-19-2016", "4-28-2016", "5-1-2016", "5-10-2016"]; if ( $('input.date-pick').length ) { $('input[name="date"]').datepicker({ startDate: tour_start_date, endDate: tour_end_date, beforeShowDay: function(date) { var m = date.getMonth(); var d = date.getDate();
Get values from range slider -Jquery UI
HI I am using jquery-UI range slider to pick 2 values (min & max). I need to get the 2 values identifiers for using it in the php code I have. Could not understand what are the identifiers. please let me know what are they ? here's my code: <script> $(function() { $( "#range-div" ).slider({ range: true, min: 16, max: 120, values: [ 16, 45 ], slide: function( event, ui ) { $( "#amount" ).val( ui.values[ 0 ] + " - " + ui.values[ 1 ] ); } });
connect "Filterable inside custom select " to mysql
Hello. I have a problem. I want to use "Jquery Mobile 1.4.5 Filterable inside custom select" with a Mysql database for afficharge the list. with version 1.4.5 jquery mobile. I would insert url connection file to the database in java script. pourvez you help me? <?php $mysql_hostname = 'xxxxxxxxxx'; $mysql_user = 'xxxxxxx'; $mysql_database = 'xxxxxx'; $mysql_password ='xxxxxxxx'; $mysqli = new mysqli($mysql_hostname,$mysql_user, $mysql_password, $mysql_database); $q = "select id, value, cyti from
The popup text doesn't appear on clicking
Hi, there! First of all, I want to apologize for my poor English (I'm brasilian). I'm developing a website and I added an interactive map in it, but when I mouse over a location on the map, the name doesn't appear. What am I doing wrong? Does anybody can please help me? If so, there's a link were you can check it out: www.plataformaes.com.br/teste The page isn't ready yet: you need scroll down the page until "Presença Internacional" to see the map. Thank you very much.
Problems with jquery in magento
Hello, I have a problem with jquery integrated into magento. Code was used to send emails to customers (using php mail function). In IE,Chrome work fine, but not in Mozilla and Safari browsers. I have tried to host it in the server (not in magento) and it works, with all browsers. I tried to use "noConflict();",but didn't help. Does anyone know the problem?? Many thanks for your answers. This is the code $(document).ready(function(){ $('#postcode').keyup(function() { $(this).val($(this).val().toUpperCase());
remove click files and submit php
https://jsfiddle.net/vcode/65w3j6rt/ <form action="" method="post" enctype="multipart/form-data"> <div id="drop-zone"> <p>Drop files here...</p> <div id="clickHere">or click here.. <i class="fa fa-upload"></i> <input type="file" name="file[]" id="file" multiple /> </div> <div id='filename'></div> </div> <input type="submit" value="GO"> </form> *sql_insert.php : print_r($_FILES); When I click the button removes any file This is what I want: After clicking
.button chrome / mobile outline
I cannot get rid of the outline from the .button element when it gets focus on Chorme and mobile browsers, despite having * { outline: none !important; } and also peppering outline: none !important; on every class in my themes file. Where should i be looking to fix this?
Bug: The IE (v: 11.162.x) triggers the wrong event #3036
Hi, I opend a bug in the bugtracker, but it was direct closed. So I hope that I get more help in this forum. If I run my demo in the IE 11.162.10586.0 I get the alert dialog with "Problem". In all other browsers it work as expected. Bug: https://github.com/jquery/jquery/issues/3036 JSBin: http://jsbin.com/domopikafo/edit?html,output I made a screencast to show the problem: http://screencast.com/t/RrHMleAVN3sj Thank you for your help! Regards, David
JQM Selectmenu custom filter
Hi, I've got a problem using the custom filtering of a selectmenu. First of all, the demo at http://demos.jquerymobile.com/1.4.5/selectmenu-custom-filter/ throws an error for the long list example. // After the dialog is closed, the form containing the filter input is returned to the popup. .on( "pagecontainerhide", function( event, data ) { var listview, form; // We only handle the disappearance of a dialog generated by a filterable selectmenu if ( !pageIsSelectmenuDialog(
How make a mobile menu close on click/tap?
Hi, I don't know anything about javascript. Still, I'm using this menu, but merely on the mobile version of the site (fired by a special style sheet):http://cssmenumaker.com/menu/responsive-flat-menu I don't have submenus, just 6-7 menu items after the initial menu button that opens the menu. Problem: I'd really like if the menu closed to it's original state when a menu item is clicked. I.e. the click should make two things happen: 1) open the page in question and 2) close to its original state.
Next Page