Coder Social home page Coder Social logo

quojs's Issues

How can I select the value of an select-field?

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

tap has no tapStart event?

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?

Error when calling $$.post

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.

.val('') dont clear the value and either .html('')

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 :)

Events trigger duplicated callbacks

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');
});

drag object

hi!
is there a demo available for dragging an object? how smooth and fast?
thanx

h.

$$.ready not working

$$.ready() is not working but $$().ready() is, because ready() is an instance method and not static.
The documentation suggests otherwise so its either an error in the documentation or an error in the code.
Screen Shot

selector by ID?

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.

[Question] Browser Support

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.

Getting dom element dimensions doesn't work right

I'm not sure if this is really an issue or maybe a tweak it would be nice to have.

Explanation:

$$.fn.width() method and $$.fn.style() methods are not homogeneous, they return different values for the width property.

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.

Question: Event handler

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

.submit() function on quo.js?

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 ;)

singleTap not working for dynamically inserted items

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.

Event delegation

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.

.tap fires twice?

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");
});

IE10 problem

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 events prevented during threshold constraint

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.

Supported OS & device list

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!

Don't work with xml?

Hi,

When try get children of a xml element, only obtain an «TypeError: Array.prototype.slice called on null or undefined»

However, if I try with the a DOM element, it's working properly.

Thanks.

not_work_with_xml

Uncaught TypeError: undefined is not a function

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.

Input Events Failing

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.

QuoJS 2.3

I use QuoJS with Lungo 2.1, install via bower in project folder.

But open in Safari,Chrome, i see error in QuoJS :(

2013-01-29 01 54 07 pm

How i can fix it?

OS: Mac OS X 10.8.2, Chrome (24.0.1312.56), Safari (6.0.2 (8536.26.17))

No native pinch to zoom

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.

is(':checked') missing

Hey there,
how can I check, if a selected checkbox is checked? In jQuery I can do this with $(this).is(':checked') ...
Cheers
Philipp

drag not working

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.

tap returns body element

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.

Audio doesn't play with play() method with QuoJS

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.

Event when "stop swiping"

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.

Error when calling $$.json

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); }
});

Is .touch() mousedown and mouseup?

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!

http://al3x.me/MBNS

Any ideas for getting around it? I've tried .tap() with little success.

does not work in mozilla

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

Swipe and tap both happen

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.

handling events on elements dynamically added to the DOM?

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.

No swipe left & right on android 4.0.2 & chrome

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

[Request] removeAttr :)

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 :)

scroll on iPad triggers swipe?

Scrolling down or up a page is triggering swipe as well. Is there a way to setup a threshold to cancel triggering swipe?

swipe support on android 4.0

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

Library doesn't work on Galaxy Tab

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

DoubleTap is way too picky

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...

Select value html()

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

When selector is a class quojs dont respect "this" as current object

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>

Append with multiple nodes

<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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.