- Screen name: Delto1321
Delto1321's Profile
9 Posts
70 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- 25-Jun-2018 05:43 AM
- Forum: Using jQuery
On my site I toggle classes to show the mobile navigation. Next to the button I offer the possibility swipe right to open the navigation and swipe left to close it again, but i have trouble with my tables.
For big/long tables I am using
overflow: auto
which makes those tables scroll able(right & left if the content doesnt fit).
Now if I like to scroll them, the navigation gets open.
I tried something like that:
jQuery:- $( 'body' ).on('swiperight', 'body:not(.outertable)', function(){
- if($('.nav-toggle').hasClass('is-active')) {
- }else{
- navToggle.addClass('is-active');
- bodymain.addClass('main-nav');
- navContainer.addClass('is-visible');
- html.addClass('nav-open');
- }
- });
- $( 'body' ).on('swipeleft', function(){
- if($('.nav-toggle').hasClass('is-active')) {
- navToggle.removeClass('is-active');
- bodymain.removeClass('main-nav');
- navContainer.removeClass('is-visible');
- html.removeClass('nav-open');
- }
- });
But it's not working..outertable is the affected table with overflow:auto.I know there is a working possibility like that:- $( 'body' ).on('swipeleft swiperight', '.outertable', function(event) {
- event.stopPropagation();
- event.preventDefault();
- });
But this way im getting a lot of errors and performance issues.
([Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.) 100 of times on a single swipe.I like to toggle the classes ONLY if i don't swipe right over affected classes.
- 22-Nov-2016 05:52 AM
- Forum: Using jQuery
I tried already on stackoverflow - no answer :(.I have unknown many Forms and unknown many different values on my site. Thats why i would send all necessary data over the action and use it with$_GET['up']
.
I have an input field wich i would send with my form too (value is given by the user).
How can I get this value with jquery and add this to my action ?
I tried already like above, but got errors like "Jquery not defined" or "Unexpected token <" ... I´m very bad with jquery, sorry.- <form action="/de/site.html/index.php?up='.$sell['Name'].','.$sell['street'].',1,<script>$(\'.'.$a.'months1\').html(months)</script>" name="'.$a.'product_update1" method="post">
- + m:
- <input id="months'.$a.'p1" class="update_product" name="'.$a.'months1" value="1">
- <button class="delete_product" name="'.$a.'update1" type="submit"><i class="fa fa-pencil"></i></button>
- </form><br/>
- <script type="text/javscript">var months = $(\'#months'.$a.'p1\').val();</scripts>
- 08-Jul-2016 10:24 AM
- Forum: Using jQuery
Hello,i using a responsive menu (navigation). On smartphone or tablet if i scroll over the opened menu it hides automatically...Don´t understand why, but i think the problem has to do with multilevel dropdown.If i uncommend:- /* cssmenu.find('li ul').parent().addClass('has-sub');
- multiTg = function() {
- cssmenu.find(".has-sub").prepend('<span class="submenu-button"></span>');
- cssmenu.find('.submenu-button').on('click', function() {
- $(this).toggleClass('submenu-opened');
- if ($(this).siblings('ul').hasClass('open')) {
- $(this).siblings('ul').removeClass('open').hide();
- }
- else {
- $(this).siblings('ul').addClass('open').show();
- }
- });
- };*/
it doesn´t hide anymore.I rebuild it on JsFiddle (im using chrome on smartphone):- 23-Jun-2016 03:55 AM
- Forum: Using jQuery
Hello i have a problem ..I made a little "shop" system for representative. They can make orders, this orders be saved on the database with the id of each user.Then they can view there orders.Now i would create a search field with autocomplete where they can filter the orders by customer name .But the problem is that i can´t hand over the session id of the user or a variable. This way the result: each name in the database get displayed.The PHP is working (it display only the correct names) just the autocomplete doesn´t work.$(document).ready(function() {$('#vertverkauf').autocomplete({minLength: 1,source: function(request, response){$.ajax({url:"/php_fs/ajax-search-ver.php",dataType:"json",html: true,data:{term:request.term},success: function(data){response(data.slice(0,10));}});},});});$search = $_GET['term'];$idver = $_SESSION['id'];$result = $conn->query("SELECT DISTINCT `kunde` FROM `verkauf` WHERE `vertreterid` = '%$idver%' AND kunde LIKE '%$search%' ORDER BY `kunde` DESC");$daten = array();while ($row=$result->fetch_assoc()){$daten[] = $row['kunde'];}echo json_encode($daten);- 11-Dec-2015 03:13 AM
- Forum: Using jQuery UI
Hello i would made an Autocomplete function for an intern order form.
Now i would format it a little bit.
I found this function _renderItem, but don´t get working. It displays undefined for itemnumber, name and image (../images/undefined).
The choose is correct.
Jquery Version: jquery-1.11.3.
autocomplete.js:-
$(document).ready(function() { var products = $(".products").clone(); $('#search-box').autocomplete({ minLength: 1, source: function(request, response){ $.ajax({ url:"../ajax-search.php", dataType:"json", html: true, data:{term:request.term}, success: function(data){ response(data.slice(0,5)); } }); }, create: function (event,ui){ $(this).data('ui-autocomplete')._renderItem = function (ul, item) { return $('<li>') .append("<img src=../images/"+item.Image +" alt='img' />") .append('<a>' + item.Number + '<br>' + item.Name + '</a>') .appendTo(ul); }; } });
ajax-search.php:-
$product = $_GET['term']; $result = $conn->query("SELECT `image` ,`name` , `number` FROM products WHERE name LIKE '%$product%' OR number LIKE '%$product%'"); $data = array(); while ($row=$result->fetch_assoc()){ $data[] = $row['Image'].", ".$row['Number'].", ".$row['Name']; } echo json_encode($data);
- 20-Nov-2015 06:31 AM
- Forum: Using jQuery
I´m working on a Lightbox where users can open it for watching videos.I were able to close the video by click on the "close button" for the Lightbox, but if i click outside of the Lightbox i get this error: "Uncaught TypeError: Cannot read property 'stopVideo' of undefined".I know the problem already but don´t know how to fix it.The problem is :var player = $(this).closest('.modal-box').data('player');if i cklick the close button the player can be selected, but if i click outside in the body there is no player in this container.<body><div="contant with video"></div><div="js plugin supersized"></div><div="and the outside of the container where it should close"></div></body>How can i fix this mistake ?JsFiddle: http://jsfiddle.net/4f5dksj5/7/- This div container isn´t displayed and is located under the click element.
Now i tried to center it vertical but withouth success.- $(window).resize(function() {
- $(".modal-box").css({
- top: (($(window).height() - $(".modal-box").outerHeight() / 2) + $(window).scrollTop() + "px")
- });
- });
The problem is: At the beginning the div is almost out of the bottem screen and divs below gone out of top screen.
I would have each div in the middle of the screen, no matter of the position.- Hello,i work on a form, who a user can add details about a customer and choose products wich the customer bought.For this i used an ajax autocomplite script i found on this page : click hereThe function works nice already. And i get the details and product as email, but i would expand like that:If the user chose a product (by clicking on a product), the table row should be dublicated and the user should add another product.I changed already small things but the main code is on the linked page already.How i can realize that ?
- Hello,i found a simple slideshow scipt on this page, wich works nice for me.The only problem is, i can´t add descriptions/caption for pictures. This way i need help for a rework.The creater has written in the comments the easiest way should be to use a div for each image and a span with text in it.I tried and changed in the Jquery the img tags with div tags, but i dont get it to run (im a beginner :().I added the Code on JSFiddle Click. And here the updated Code i tried, but the images are´nt showed more.
- «Prev
- Next »
Moderate user : Delto1321
© 2013 jQuery Foundation
Sponsored by and others.

