- Screen name: thomtomdup
thomtomdup's Profile
5 Posts
3 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- Hello.I use the new jQuery mobile 1.3.0 and i discovered the swipe panel demo.I implement it on my web site (m.optimumgym.fr). It work fine when you launch the page directly but not when you click on the link on the menu (the swipe panel)The exemple code of page :
- $( document ).on( "pageinit", "#demo-page", function() {
- $( document ).on( "swipeleft swiperight", "#demo-page", function( e ) {
- // We check if there is no open panel on the page because otherwise
- // a swipe to close the left panel would also open the right panel (and v.v.).
- // We do this by checking the data that the framework stores on the page element (panel: open).
- if ( $.mobile.activePage.jqmData( "panel" ) !== "open" ) {
- if ( e.type === "swipeleft" ) {
- $( "#right-panel" ).panel( "open" );
- } else if ( e.type === "swiperight" ) {
- $( "#left-panel" ).panel( "open" );
- }
- }
- });
- });
my code :- $( document ).on( "pageinit", "#pagePrincipal", function() {
- $( document ).on( "swiperight", "#pagePrincipal", function( e ) {
- // We check if there is no open panel on the page because otherwise
- // a swipe to close the left panel would also open the right panel (and v.v.).
- // We do this by checking the data that the framework stores on the page element (panel: open).
- if ( $.mobile.activePage.jqmData( "panel" ) !== "open" ) {
- if ( e.type === "swiperight" ) {
- $( "#myMenu" ).panel( "open" );
- }
- }
- });
- });
Do you know what is the problem of this ?Thank you in advance.Best regards.- 10-Dec-2010 10:27 AM
- Forum: jQuery Mobile
Hello.JQuery developer I am starting mobile development in jquery mobile 1.0a2 and I noticed something:The back button is always displayed even if there is no history before when we add a select menu on the page. When i remove the select menu, the back button disappears. Is this normal or a bug?Thank you in advance.Ps : Good job for this frameworkI added some new features in jQuery.browser class . I propose you to share it. I added the distinction between the browser chrome and safari and i added detection of browser language. Is this for you a good idea ?
--------------------------------------------------------------------(for Jquery-1.4.js)--------------------------------------------------------
uaMatch: function( ua ) {
var ret = { browser: "" };
ua = ua.toLowerCase();
if ( /chrome/.test( ua ) && !/compatible/.test( ua ) ) {
ret = { browser: "chrome", version: (ua.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1], language:"" };
} else if ( /webkit/.test( ua ) ) {
ret = { browser: "safari", version: /webkit[\/ ]([\w.]+)/, language:"" };
} else if ( /opera/.test( ua ) ) {
ret = { browser: "opera", version: /version/.test( ua ) ? /version[\/ ]([\w.]+)/ : /opera[\/ ]([\w.]+)/, language:"" };
} else if ( /msie/.test( ua ) ) {
ret = { browser: "msie", version: /msie ([\w.]+)/, language:"" };
} else if ( /mozilla/.test( ua ) && !/compatible/.test( ua ) ) {
ret = { browser: "mozilla", version: /rv:([\w.]+)/, language:"" };
}else
ret.version = (ret.version && ret.version.exec( ua ) || [0, "0"])[1];
ret.language = navigator.language? navigator.language : navigator.userLanguage;
return ret;
},
browser: {}
});
browserMatch = jQuery.uaMatch( userAgent );
if ( browserMatch.browser ) {
jQuery.browser[ browserMatch.browser ] = true;
jQuery.browser.version = browserMatch.version;
jQuery.browser.language = browserMatch.language;
}
-------------------------------------------------------------------------(for Jquery-1.4-min.js)----------------------------------------------------------------
{var b={browser:""};a=a.toLowerCase();if(/chrome/.test(a))b={browser:"chrome",version: (a.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ )||[0,'0'])[1],language:""};else if(/webkit/.test(a))b={browser:"safari",version:/webkit[\/ ]([\w.]+)/,language:""};else if(/opera/.test(a))b={browser:"opera",version:/version/.test(a)?/version[\/ ]([\w.]+)/:/opera[\/ ]([\w.]+)/,language:""};else if(/msie/.test(a))b={browser:"msie",version:/msie ([\w.]+)/};else if(/mozilla/.test(a)&& !/compatible/.test(a))b={browser:"mozilla",version:/rv:([\w.]+)/,language:""};b.version=(a.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1]; b.language=navigator.language? navigator.language : navigator.userLanguage;return b},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version;c.browser.language=P.language}
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thank you in advance. Have a nice day.
- 02-Feb-2009 06:53 AM
- Forum: Developing jQuery Core
<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<style>.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</style>
Hello.
I discovered some time ago that in browsers based on
WebKit, the ready not working properly. Looking into the code
of jQuery 1.3.1 in binready I noticed it was missing the code. Because
it tests only for IE and mozilla. It does not test for Opera, Safari
and Chrome.
I analyzed the version 1.2.6 and the bindready code has changed,
result, in opera, safari and chrome, the ready does not work
properly (stylesheets are loaded after the page content)
Could you give me an alternative to not put the code of 1.2.6 in 1.3.1?
Here is the code I changed. The ready work correctly with these changes :
// Figure out what browser is being used
jQuery.browser = {
version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
safari: /webkit/.test( userAgent ),
opera: /opera/.test( userAgent ),
msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ),
language: navigator.language? navigator.language : navigator.userLanguage,
chrome : /chrome/.test(navigator.userAgent.toLowerCase())
};
function bindReady(){
if ( readyBound ) return;
readyBound = true;
// Mozilla, Opera (see further below for it) and webkit nightlies currently support this event
if ( document.addEventListener && !jQuery.browser.opera
&& !jQuery.browser.safari && !jQuery.browser.chrome)
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
// If IE is used and is not in a frame
// Continually check to see if the document is ready
if ( jQuery.browser.msie && window == top ) (function(){
if (jQuery.isReady) return;
try {
// If IE is used, use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
document.documentElement.doScroll("left");
} catch( error ) {
setTimeout( arguments.callee, 0 );
return;
}
// and execute any waiting functions
jQuery.ready();
})();
if ( jQuery.browser.opera )
document.addEventListener( "DOMContentLoaded", function () {
if (jQuery.isReady) return;
for (var i = 0; i < document.styleSheets.length; i++)
if (document.styleSheets[i].disabled) {
setTimeout( arguments.callee, 0 );
return;
}
// and execute any waiting functions
jQuery.ready();
}, false);
if ( jQuery.browser.safari || jQuery.browser.chrome) {
var numStyles;
(function(){
if (jQuery.isReady) return;
if ( document.readyState != "loaded" && document.readyState != "complete" ) {
setTimeout( arguments.callee, 0 );
return;
}
if ( numStyles === undefined )
numStyles = jQuery("style, link[rel=stylesheet]").length;
if ( document.styleSheets.length != numStyles ) {
setTimeout( arguments.callee, 0 );
return;
}
// and execute any waiting functions
jQuery.ready();
})();
}
// A fallback to window.onload, that will always work
jQuery.event.add( window, "load", jQuery.ready );
}
Thank you in advance.
<a href="http://www.microsoft.com/windows/windowslive/default.aspx">
</a><br /><hr />Votre correspondant a choisi Hotmail et profite d'un stockage quasiment illimité. <a href='http://www.windowslive.fr/hotmail/default.asp' target='_new'> Créez un compte Hotmail gratuitement !</a>
Hello.
I discovered some time ago that in browsers based on WebKit, the ready
to jQuery not working properly. Looking into the code of jQuery 1.3.1
in binready I noticed it was missing the code. Because it tests only
for IE and mozilla. It does not test for Opera, Safari and Chrome.
Here is the code I found on the net. Is it possible to tell me whether
it will be added or if I should use another function. Thank you in
advance.- «Prev
- Next »
Moderate user : thomtomdup
© 2012 jQuery Foundation
Sponsored by
and others.


