soyjavi / quojs Goto Github PK
View Code? Open in Web Editor NEWMicro #JavaScript Library for Mobile Devices
License: MIT License
Micro #JavaScript Library for Mobile Devices
License: MIT License
Or I can't make it to work. Test page: http://nicholascamp.com.br/tests/quo.html
Thanks.
is there no jsonp support for cross domain json requests?
Hi,
For example:
<select name="test" id="test">
<option value="v_1">Value 1</option>
<option value="v_2">Value 2</option>
</select>
$('#test [value="v_2"]').attr('selected', true);
doesn't work (but with jquery)?
Regards
I'm trying to tap a box and start an animation on mouseDown so to speak but pressing it does not start the animation, only when I release it, the tap command starts working.
Maybe I'm using it wrong and sure; I'd expect a delay because you want to detect if there's a short or long tap. But isn't there (or shouldn't there) be a sort of a tapStart() event to be handled somewhere?
I have a $$.post sending a command to backend.php.
This backend does not echo any data and all works as expected.
$$.post("backend.php", {command: 'next'}, function(response) {});
Only when I echo something from the backend and thus change the code by:
$$.post("backend.php", {command: 'state'}, function(response) {alert(response);});
I get the following error:
Uncaught TypeError: Object # has no method 'call'
I have seen this closed issue 31 but I don't see what I do differently!
Already thanks for your help.
Hi and thanks for this great script, and thats is my issue, when I try to clear the value with .val('') it doesnt work and also when I try .html('') i've found that I use .empty(); to delete the content of the html, but I want to be able to delete it with an empty string and for val I dont know how to do that because I need to put something like a space to work, and I dont want to have a space before all the data the people save.
Thank you :)
I've testing LungoJS and I found an issue on Android 4.X.
In the init method of Lungo.Boot.Events, I put this code
document.addEventListener('touchstart', function(e){
e.preventDefault();
console.log('tap');
}, false);
and the response was just one callback call but if I use the QuoJS, the callback is called twice.
lng.dom('body').tap(function(){
console.log('tap');
});
hi!
is there a demo available for dragging an object? how smooth and fast?
thanx
h.
This way we can play with it without downloading it.
I see in HTML code that quojs.min.js (or something) isn't present, but $$('selector')
works, but just this, :S
Thanks!
sorry if this is not the right place for questions...
is there a selector by ID? as per:
//Tap Methods
lng.dom('#detailBtn').tap(function(event) {
console.log("detailBtn.tap");
alert("tap!");
});
trying to use Quo with Lungo.
var func = function() {console.log('touchstart')}
$$(window).on('touchstart', func);
after that when i do
$$(window).off('touchstart', func) -> i see "touchstart" at console anyway
I need to implement a sticky div (like this in JQuery: http://jsfiddle.net/uFq2k/) but I need scrollTop() JQuery function to implement the method. Is there any way to do it in QuoJS?
Apologies if it says somewhere on your site, docs or GitHub but I couldn't spot it. Which Mobile & Desktop Browsers have QuoJS been tested in please?
Thanks a lot, great looking project.
I'm not sure if this is really an issue or maybe a tweak it would be nice to have.
Explanation:
What i saw is that one is returning the offsetWidth and the other one the computedStyle
Suppose i have this html code.
<input type="text" name="test" id="test" />
and the following JS:
$$(document).ready(function() {
var input = $$('#test');
input.style('width', '400px');
console.log(input.style('width')); // '400px'
console.log(input.widht()); // 404
});
As you can see it's weird because imagine you are changing the width of an object and then in another part of your code you ask it's width using input.width(), you get a different size.
Hey guys,
perhaps I'm just a little bit dump, but: how can I achieve this examples with QuoJS:
jQuery('textarea.note').live('keypress', function() {
alert('keypress');
});
jQuery('textarea.note').live('keydown', function() {
alert('keydown');
});
jQuery('textarea.note').live('keyup', function() {
alert('keyup');
});
I tried:
$$('textarea.note').on('keyup', function() {
alert('keyup');
});
What's wrong?!
Cheers
Philipp
I have a login form and a search input on my Lungo.js app
I want to make like a .submit() (like jquery) but I don't see any method support by quo.js
Now I am using the tap function on the button but it is not enought. I can try to use the letdown hack to especify the "return" button but I don't like the idea
Any idea to solve it?
Thanks a lot ;)
You mentioned here #39 (comment)
that the latest version of QuoJS had support for dynamically inserted elements. However when appending a new menu item to my aside,
$$('#menu a').on('singleTap', function() { });
Does not work on the newely appended elements.
I am appending with jQuery if that makes any difference.
Nice module! 👍 I really like the simplicity and focus on mobile. But there's one feature I'm missing.
Have you planned to implement some simple form of event delegation? I often use this feature as it is a convenient way to add one listener for a whole list of elements.
For some reason my alert fires twice. Any ideas? I can post more code if this is not enough information.
$$('.verse-container').tap(function() {
$$(this).addClass('tapped');
alert("tap");
});
Hi,
When I open my website with IE10 it starts giving
"Object doesn't support property or method 'ready' "
I can't figure out what the problem is. I need this library very much.
Please fix this issue.
thanks
Pinching will stop sending "pinching" events while the difference between fingers is within the range -10 and 10.
_capturePinch = function() {
var diff, distance;
distance = parseInt(_distance(CURRENT_TOUCH), 10);
diff = GESTURE.initial_distance - distance;
if (Math.abs(diff) > 10) {
GESTURE.distance_difference = diff;
return _trigger("pinching", {
distance: diff
});
}
};
This logic is useful to initially determine a "pinching" threshold but causes issues when users pinches in/out (without lifting from the pinch gesture) and reaches the threshold.
Hi Soyjavi, Just wondered if there is a list of devices tested successfully using QuoJS.
So far I've had no problems with Ipad and Android Gingerbread, Chrome & Firefox.
Had issues with Windows mobile (IE9) and strangely enough a Samsung Galaxy 3.
Are there workarounds for these phones?
Cheers, for the great work so far!
i want to attach the tap event on my list,but the tap event would be triggered when i swipe the page on the list,how to resolve this problem?
I 've found console logs an error both firefox and chrome. This occurs on load the script
Firefox: TypeError: e is not a function
...;i=[];j=[];f=void 0;["doubleTap","hold","swipe","swiping","swipeLeft","swipeRigh... line 45
Chrome:
Uncaught TypeError: undefined is not a function line 45
I don't know if this error stops the script or affects the functionality
Regards.
I've tried several times to test touch input events with no success.
Is there something wrong with this code?
<p style="font-size: 40px; background-color: yellow; width: 64px; height: 64px; display: block;">
ununuunnnunnunununu<span>mimiiimiimmi</span>
</p>
<script>
// Chaining methods (works fine atm)
$$('p > span').html('tapquo').style('color', 'blue');
$$('p').swiping(function() {
$$('p', this).style('background-color', 'red');
});
</script>
You can find a live version here if you would like to test it yourself:
http://terrachaos.net/web/
Thank you.
Hi I might have missed something but it seem as though Quo completely overrides the native Pinch to zoom on websites on iOS. It would be really nice if there was away to still use QuoJS and keep the pinch to zoom a website the users are so familiar with.
Hey there,
how can I check, if a selected checkbox is checked? In jQuery I can do this with $(this).is(':checked') ...
Cheers
Philipp
Here is the report. There are undeclared variables.
hi!
just downloaded v2.3. tried quo.js - all working, but not:
.drag(function);
what is the function for?
.draggable(function); ?
.dragRight(function); ?
– or something else?
thank you for help - h.
When using tap() to bind a function to the tap event the body element is returned, rather than the element that is being worked with. This means you can't do function chaining. You have to stop with the tap() call.
Ex.
$$('#myelement').tap( tapFunction ).swipeLeft( swipeFunction );
That swipeLeft call gets bound to the body element, not the #myelement element.
Hi,
When I try to play an 'audio' element with QuoJS, nothing happens.
Here is the code I'm using: https://gist.github.com/1621963
If I click the 'play' link at chrome/safari it works fine. The audio plays and the duration is logged to the console.
If I try it in safari mobile, both iPhone Simulator or real iPad, the audio doesn't play and the console.log() writes 'NaN'
I've the same issue with Lungo 1.0.4 but it works fine using zepto.js and without any library.
Best,
César.
There is an event for swiping, and in my app I capture the scrollTop when I swipe on it, but I want to call a function when I stop the swipe.
How can I do this?
Thank you.
I tried to retrieve a simple json document with the current quo.js from the website. But I keep on getting this error in line 38 (minified version):
Uncaught TypeError: Object #<Object> has no method 'call'
The call I do is the following:
$$.json(location.href + 'sample.json', function(response) {
console.log(response);
});
Retrieving the same document with this Ajax call works fine:
$$.ajax({
url: location.href + 'sample.json',
dataType: 'json',
async: true,
success: function(response) { console.log(response); },
error: function(xhr, type) { console.log(xhr, type); }
});
A strange one, it seems when using .touch() to close an aside, it also touches the elements that slide into it's original place, meaning it clicks items that shouldn't be clicked.
A video would best show this!
Any ideas for getting around it? I've tried .tap() with little success.
I am making a request with $$json, but it generates error in mozilla.
NS_ERROR_XPC_NOT_ENOUGH_ARGS: Not enough arguments
[Parar en este error]
return this.insertBefore(value);
thanks
if you define a swipe (like swipe right) handler and a tap handler for one element, a swipe will result in both handlers being triggered.
So if you have some sort of gallery--you would like to swipe through and then tap on one of the options to see more. At the moment, every swipe will act as a tap.
Hello,
I want to know if someone knows how or what is the way to handle events on elements dynamically added to the DOM?, since the next examples don't do.
$$('.swipeme_right').swipeRight( function(event) {
$$(this).children('.bubble').toggleClass('hidden');
});
$$('.swipeme_right').bind('swipeRight', function(event) {
$$(this).children('.bubble').toggleClass('hidden');
});
$$('.swipeme_right').delegate('li', 'swipeRight', function(event) {
$$(this).children('.bubble').toggleClass('hidden');
});
$$('.swipeme_right').on('swipeRight', 'li', function() {
$$(this).children('.bubble').toggleClass('hidden');
});
All four examples do the same.
I think that it should be by using the delegate method() but does not, or maybe with the method on() like jquery 1.7 but neither does.
Thank you in advance.
Currently I'm developing an app with lungo and quojs ,and we are experiencing some weird problems on android devices.
There are no left & right swipe events. (or at least not working properly )
I'm testing on Nexus 7 with the latest chrome browser.
However these events are properly detected on iOS devices (ipad/mini,iphone) (and firefox os too)
Please let me know how can I help you to fix those bugs
Edit : // turns out there is a bug in chrome for andoid : https://code.google.com/p/chromium/issues/detail?id=152913
and https://code.google.com/p/chromium/issues/detail?id=172533
Hello and thank you for repairing the previous bug, I want to know if is possible to remove an attribute from an html element, because of the selected and checked attrs.
Note : I already did $$('#elemID').attr('disabled', false); but this is not working.
Thank you :)
Scrolling down or up a page is triggering swipe as well. Is there a way to setup a threshold to cancel triggering swipe?
Was able to perform a swipeLeft and swipeRight call correctly on my chrome browser as well as android 2.4 phone but its not working for chrome on android 4.0
Hi there,
I've tested QuoJS on several devices but I couldn't get it working on Samsung Galaxy Tab with Android 3.2 (Japanese version, Webkit version unknown)
The test script I used :
$$('.sidenav').swipeLeft(function() {
alert("nav");
});
$$('.page-content').swipeRight(function() {
alert("content");
});
This worked even on my old HTC Wildfire(Android 2.2.1, Webkit 3.1) which I found rather odd.
Thanks in advance for any feedback.
Cheers
seems like the max time between two taps to be interpreted as a doubleTap is hard coded to 250ms. is that right?
Well, testing on iOS that seems not to be enough. it's less then 10% success...
I am trying to capture the value chosen is a select but I generate error
$$('#select1').on("change",function(){
name_select= $$('#select1 option:selected').html();
});
ERROR
Uncaught Error: SYNTAX_ERR: DOM Exception 12
thanks
Check this comparison
With jquery this work as expected
<script type="text/javascript">
$(function() {
$('.swipe').on('click', function () {
$('.bubble', this).toggleClass('hidden');
});
});
</script>
With QuoJS all elements with the specified selector are affected
<script type="text/javascript">
$$(document).ready(function() {
$$('.swipe').tap(function() {
$$('.bubble', this).toggleClass('hidden');
});
});
</script>
On this elements
<ul>
<li class="swipe" id="111">Item 111
<div class="bubble onright red hidden" data-icon="remove" id="aaa">Remove</div>
<li class="swipe" id="222">Item 222
<div class="bubble onright red hidden" data-icon="remove" id="bbb">Remove</div>
<li class="swipe" id="333">Item 333
<div class="bubble onright red hidden" data-icon="remove" id="ccc">Remove</div>
</ul>
<div id="elem"></div>
if you do:
$$('#elem').prepend('<p>1</p><p>2</p><p>3</p>');
<div id="elem"><p>1</p><p>2</p><p>3</p></div>
It works well, but with append:
$$('#elem').append('<p>1</p><p>2</p><p>3</p>');
It only appends the first element
<div id="elem"><p>1</p></div>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.