jQuery Plugins » Questions & Answers https://jqueryplugins.info jQuery plugins, tutorials and resources Wed, 22 Feb 2012 22:14:51 +0000 en hourly 1 http://wordpress.org/?v=3.2.1 google Map v2 to v3 https://jqueryplugins.info/2012/02/google-map-v2-to-v3/ https://jqueryplugins.info/2012/02/google-map-v2-to-v3/#comments Wed, 22 Feb 2012 22:14:51 +0000 Admin https://jqueryplugins.info/2012/02/google-map-v2-to-v3/ Post link: google Map v2 to v3

Ok, so I am currently using Google Maps v2 and want to upgrade my code to V3. I am wondering how do I change the follow code from v2 to...

]]>
Post link: google Map v2 to v3

Ok, so I am currently using Google Maps v2 and want to upgrade my code to V3.

I am wondering how do I change the follow code from v2 to v3.

The main difference is that I see new Gmap2 has changed to new google.maps.Map

if someone can help that would be great

function stores()
{
    $  ('#storelist ul#stores').html("");
    fetch(203,"task=location&location=vic");
    map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(-37.810013, 144.962683), 8);
    map.setUIToDefault();
    yellowIcon.image = "http://gmaps-samples.googlecode.com/svn/trunk/markers/orange/blank.png";

    map.setMapType(G_NORMAL_MAP);
    markerOptions = { icon:yellowIcon };

}

//ADDRESSFETCH
function showAddress(address) {
    map = new GMap2(document.getElementById("map2"));
    map.setCenter(new GLatLng(-37.810013, 144.962683), 8);
    geocoder = new GClientGeocoder();

setTimeout(function(){
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {

            if (!point) {
              alert(address + " not found");
            } else {
              map.setCenter(point, 15);
              var marker = new GMarker(point, {draggable: true});
              map.addOverlay(marker);

          GEvent.trigger(marker, "click");
            }
          }
        );
    }
},1000);
}

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2012/02/google-map-v2-to-v3/feed/ 0
Jquery plugin for video player from third party video sites https://jqueryplugins.info/2012/02/jquery-plugin-for-video-player-from-third-party-video-sites/ https://jqueryplugins.info/2012/02/jquery-plugin-for-video-player-from-third-party-video-sites/#comments Wed, 22 Feb 2012 21:13:05 +0000 Admin https://jqueryplugins.info/2012/02/jquery-plugin-for-video-player-from-third-party-video-sites/ Post link: Jquery plugin for video player from third party video sites

I am offering users to share video links from various third party sites like youtube, vimeo etc. I want to playback those videos on my site like pintrest and other...

]]>
Post link: Jquery plugin for video player from third party video sites

I am offering users to share video links from various third party sites like youtube, vimeo etc.

I want to playback those videos on my site like pintrest and other websites are doing. I am not able to find out some free jquery plugin for this. Flowplayer etc are solutions but they are not free.

Any suggestions?

PS: I dont want to have a modal box or something.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2012/02/jquery-plugin-for-video-player-from-third-party-video-sites/feed/ 0
assign value of html textbox to title of div https://jqueryplugins.info/2012/02/assign-value-of-html-textbox-to-title-of-div/ https://jqueryplugins.info/2012/02/assign-value-of-html-textbox-to-title-of-div/#comments Wed, 22 Feb 2012 20:15:20 +0000 Admin https://jqueryplugins.info/2012/02/assign-value-of-html-textbox-to-title-of-div/ Post link: assign value of html textbox to title of div

line 1: <input id="Text1" type="text" /><input id="Button1" type="button" value="button" /><br /> line 2: <a target="_blank" href="http://search.twitter.com/search?q=#msdhoni">#msdhoni</a> What I want- when a user input some thing in text box (in line...

]]>
Post link: assign value of html textbox to title of div

line 1:

<input id="Text1" type="text" /><input id="Button1" type="button" value="button" /><br />

line 2:

<a target="_blank" href="http://search.twitter.com/search?q=#msdhoni">#msdhoni</a>

What I want- when a user input some thing in text box (in line 1) that should become the title of the div (in line 2) on click of the botton (in line 1). Actually want to replace #msdhoni everywhere in code with the text input in the textbox.

Jquery code I m using:(Please suggest the change in this code to make this possible)

String.prototype.linkify=function(){
return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&;\?\/.=]+/g,function(m){
    return m.link(m);
});
};
String.prototype.linkuser=function(){
return this.replace(/[@]+[A-Za-z0-9-_]+/g,function(u){
    return u.link("http://twitter.com/"+u.replace("@",""));
});
};
String.prototype.linktag=function(){
return this.replace(/[]+[A-Za-z0-9-_]+/,function(t){
    return t;
});
};

var showTweetLinks='none';
function fetch_tweets(elem){
elem = $  (elem);

keyword = escape(elem.attr('title'));

num=elem.attr('class').split(' ').slice(-1);

var url = "http://search.twitter.com/search.json?q=" +keyword+ "&rpp=" + num + "&callback=?";
$  .getJSON(url,function(json){
    $  (json.results).each(function(){
        var tTime=new Date(Date.parse(this.created_at));
        var cTime=new Date();
        var sinceMin=Math.round((cTime-tTime)/60000);
        if(sinceMin==0){
            var sinceSec=Math.round((cTime-tTime)/1000);
            if(sinceSec<10)
                var since='less than 10 seconds ago';
            else if(sinceSec<20)
                var since='less than 20 seconds ago';
            else
                var since='half a minute ago';
        }
        else if(sinceMin==1){
            var sinceSec=Math.round((cTime-tTime)/1000);
            if(sinceSec==30)
                var since='half a minute ago';
            else if(sinceSec<60)
                var since='less than a minute ago';
            else
                var since='1 minute ago';
        }
        else if(sinceMin<45)
            var since=sinceMin+' minutes ago';
        else if(sinceMin>44&&sinceMin<60)
            var since='about 1 hour ago';
        else if(sinceMin<1440){
            var sinceHr=Math.round(sinceMin/60);
            if(sinceHr==1)
                var since='about 1 hour ago';
            else
                var since='about '+sinceHr+' hours ago';
        }
        else if(sinceMin>1439&&sinceMin<2880)
            var since='1 day ago';
        else{
            var sinceDay=Math.round(sinceMin/1440);
            var since=sinceDay+' days ago';
        }
        var tweetBy='<a class="tweet-user" target="_blank" href="http://twitter.com/'+this.from_user+'">@'+this.from_user+'</a> <span class="tweet-time">'+since+'</span>';
        if(showTweetLinks.indexOf('reply')!=-1)
            tweetBy=tweetBy+' &middot; <a class="tweet-reply" target="_blank" href="http://twitter.com/?status=@'+this.from_user+' &in_reply_to_status_id='+this.id+'&in_reply_to='+this.from_user+'">Reply</a>';
        if(showTweetLinks.indexOf('view')!=-1)
            tweetBy=tweetBy+' &middot; <a class="tweet-view" target="_blank" href="http://twitter.com/'+this.from_user+'/statuses/'+this.id+'">View Tweet</a>';
        if(showTweetLinks.indexOf('rt')!=-1)
            tweetBy=tweetBy+' &middot; <a class="tweet-rt" target="_blank" href="http://twitter.com/?status=RT @'+this.from_user+' '+escape(this.text.replace(/&quot;/g,'"'))+'&in_reply_to_status_id='+this.id+'&in_reply_to='+this.from_user+'">RT</a>';
        var tweet='<div class="tweet"><div class="tweet-left"><a target="_blank" href="http://twitter.com/'+this.from_user+'"><img width="48" height="48" alt="'+this.from_user+' on Twitter" src="'+this.profile_image_url+'" /></a></div><div class="tweet-right"><p class="text">'+this.text.linkify().linkuser().linktag().replace(/<a/g,'<a target="_blank"')+'<br />'+tweetBy+'</p></div><br style="clear: both;" /></div>';
        elem.append(tweet);
    });
});
return(false);
}
$  (function(){
showTweetLinks=showTweetLinks.toLowerCase();
if(showTweetLinks.indexOf('all')!=-1)
    showTweetLinks='reply,view,rt';
$  ('.twitStream').each(function(){
    fetch_tweets(this);
});
});

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2012/02/assign-value-of-html-textbox-to-title-of-div/feed/ 0
How to hide all text, which are smaller than certain pixel and bring them back later using Javascript? https://jqueryplugins.info/2012/02/how-to-hide-all-text-which-are-smaller-than-certain-pixel-and-bring-them-back-later-using-javascript/ https://jqueryplugins.info/2012/02/how-to-hide-all-text-which-are-smaller-than-certain-pixel-and-bring-them-back-later-using-javascript/#comments Wed, 22 Feb 2012 19:13:10 +0000 Admin https://jqueryplugins.info/2012/02/how-to-hide-all-text-which-are-smaller-than-certain-pixel-and-bring-them-back-later-using-javascript/ Post link: How to hide all text, which are smaller than certain pixel and bring them back later using Javascript?

I’m working on a project, which in some cases requires to hide all small text (eg. less than 12px), and on some other event, bring them back. It’s not a...

]]>
Post link: How to hide all text, which are smaller than certain pixel and bring them back later using Javascript?

I’m working on a project, which in some cases requires to hide all small text (eg. less than 12px), and on some other event, bring them back. It’s not a website, but something happening on the webkit browser. I don’t have control over the content on the page (developed by the third party developers), but have control to modify it. I know I can loop through all tag elements and check font sizes and hide them if smaller than 12px, but it’s not only inefficient, but the text can be changed to be shown again, say after an ajax call, which is “prohibited”. Other solution would be to run that loop every couple seconds, but it’s an expensive process.

Other task is to show small text on some other event, which is not too difficult to implement by just using simple custom class.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2012/02/how-to-hide-all-text-which-are-smaller-than-certain-pixel-and-bring-them-back-later-using-javascript/feed/ 0
How do I check if 2 jQuery selectors are pointing to the same element(s)? https://jqueryplugins.info/2012/02/how-do-i-check-if-2-jquery-selectors-are-pointing-to-the-same-elements/ https://jqueryplugins.info/2012/02/how-do-i-check-if-2-jquery-selectors-are-pointing-to-the-same-elements/#comments Wed, 22 Feb 2012 18:13:37 +0000 Admin https://jqueryplugins.info/2012/02/how-do-i-check-if-2-jquery-selectors-are-pointing-to-the-same-elements/ Post link: How do I check if 2 jQuery selectors are pointing to the same element(s)?

If I try something such as this: $ (".foo") === $ (".foo") // = false … I get false. If I instead try this query, $ (".foo").get(0) === $ (".foo").get(0)...

]]>
Post link: How do I check if 2 jQuery selectors are pointing to the same element(s)?

If I try something such as this:

$  (".foo") === $  (".foo") // = false

… I get false. If I instead try this query,

$  (".foo").get(0) === $  (".foo").get(0) // = true

… I get true.

That’s because:

{a:myObject} !== {a:myObject};
[myObject]   !== [myObject];
myObject     === myObject;

I’m wondering if there is any succinct way to test for this equality, preferably built into jQuery. The 2nd method I wrote only works correctly if there is at most one element which matches .foo. The solution should work for any amount of elements.

Obviously I don’t want to just check ".foo" === ".foo" since the actual selections I’m using are more complicated. I just simplified them for this example. (E.g. I may want to check that $ (this) is selecting the same thing as $ (".foo").)

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2012/02/how-do-i-check-if-2-jquery-selectors-are-pointing-to-the-same-elements/feed/ 0
echo value from 1 input box into another with jQuery https://jqueryplugins.info/2012/02/echo-value-from-1-input-box-into-another-with-jquery/ https://jqueryplugins.info/2012/02/echo-value-from-1-input-box-into-another-with-jquery/#comments Wed, 22 Feb 2012 17:13:12 +0000 Admin https://jqueryplugins.info/2012/02/echo-value-from-1-input-box-into-another-with-jquery/ Post link: echo value from 1 input box into another with jQuery

I have an AJAX powered form which is more like a 5 step wizard. There are no page refreshes until the data is submitted at the very end. On an...

]]>
Post link: echo value from 1 input box into another with jQuery

I have an AJAX powered form which is more like a 5 step wizard. There are no page refreshes until the data is submitted at the very end.

On an earlier step a value is entered into a HTML text field and I would like to have those same values present in another text box on the last page as they review the final details of their submission before they hit send..

I think it needs to be done with an onChange event but I cannot seem to get it to work fully, I am a PHP developer so am still working on my jQuery skills. Here is the code I wrote with no success:

<script type="text/javascript">
$  (document).ready(function() {
$  ("#textbox1").change(function()
        {
    var text = $  ("#textbox1").val();
    $  ("#textbox2").html(text);
        });
});
</script>

Thanks in advance gents.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2012/02/echo-value-from-1-input-box-into-another-with-jquery/feed/ 0
Wrap bb code around selected text in a content editable DIV https://jqueryplugins.info/2012/02/wrap-bb-code-around-selected-text-in-a-content-editable-div/ https://jqueryplugins.info/2012/02/wrap-bb-code-around-selected-text-in-a-content-editable-div/#comments Wed, 22 Feb 2012 16:18:17 +0000 Admin https://jqueryplugins.info/2012/02/wrap-bb-code-around-selected-text-in-a-content-editable-div/ Post link: Wrap bb code around selected text in a content editable DIV

So I am trying to create an RTE environment. I have a content editable div and I would like to allow the user to select text and then press a...

]]>
Post link: Wrap bb code around selected text in a content editable DIV

So I am trying to create an RTE environment.
I have a content editable div and I would like to allow the user to select text and then press a button which would wrap BBCode around it.

I have tried creating the following function, However, the selected text is just replaced.
It doesn’t seem to be storing the proper valu ein selectedText

function wrap(tag)
{

    var sel, range;
    if (window.getSelection)
     {
        sel = window.getSelection();
        if (sel.rangeCount)
         {
            range = sel.getRangeAt(0);
            var selectedText = range;
            range.deleteContents();
            range.insertNode(document.createTextNode('['+tag+']'+selectedText+'[/'+tag+']'));
        }
    }
    else if (document.selection && document.selection.createRange)
    {
        range = document.selection.createRange();
        selectedText = document.selection.createRange().text;
        console.log(text);
        range.text = '['+tag+']'+text+'[/'+tag+']';
    }
}

</script>

JQuery is acceptable but I’d prefer regular Javascript.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2012/02/wrap-bb-code-around-selected-text-in-a-content-editable-div/feed/ 0
Get Browser Width and Height Excluding Toolbars and Menu Size https://jqueryplugins.info/2012/02/get-browser-width-and-height-excluding-toolbars-and-menu-size/ https://jqueryplugins.info/2012/02/get-browser-width-and-height-excluding-toolbars-and-menu-size/#comments Wed, 22 Feb 2012 15:14:09 +0000 Admin https://jqueryplugins.info/2012/02/get-browser-width-and-height-excluding-toolbars-and-menu-size/ Post link: Get Browser Width and Height Excluding Toolbars and Menu Size

I need a Js / JQuery Script , which return me browser’s available width and height excluding menu bar and toolbar size , i am using one script but it...

]]>
Post link: Get Browser Width and Height Excluding Toolbars and Menu Size

I need a Js / JQuery Script , which return me browser’s available width and height excluding menu bar and toolbar size , i am using one script but it seems to be returning width / height including toolbar ect…

below is script i have used..

<script type="text/javascript" >
var winWidth = 0, winHeight = 0;
        if (typeof (window.innerWidth) == 'number') {
            //Non-IE
            winWidth = window.innerWidth;
            winHeight = window.innerHeight;
        } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
            //IE 6+ in 'standards compliant mode'
            winWidth = document.documentElement.clientWidth;
            winHeight = document.documentElement.clientHeight;
        } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
            //IE 4 compatible
            winWidth = document.body.clientWidth;
            winHeight = document.body.clientHeight;
        }
</script>

Any body have any clue on this?
Thanks
Meghana

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2012/02/get-browser-width-and-height-excluding-toolbars-and-menu-size/feed/ 0
jquery sdocml not working in aptana studio 3 for eclipse https://jqueryplugins.info/2012/02/jquery-sdocml-not-working-in-aptana-studio-3-for-eclipse/ https://jqueryplugins.info/2012/02/jquery-sdocml-not-working-in-aptana-studio-3-for-eclipse/#comments Wed, 22 Feb 2012 14:14:52 +0000 Admin https://jqueryplugins.info/2012/02/jquery-sdocml-not-working-in-aptana-studio-3-for-eclipse/ Post link: jquery sdocml not working in aptana studio 3 for eclipse

I first installed the Ruble and it didn’t work. Then I read the instructions and place the jquery sdocml file in my project but it still didn’t work. Even after...

]]>
Post link: jquery sdocml not working in aptana studio 3 for eclipse

I first installed the Ruble and it didn’t work. Then I read the instructions and place the jquery sdocml file in my project but it still didn’t work. Even after restarting eclipse and making a new javascript file, I still get no code hinting. I have tried both 1.4.2 and 1.6.2 sdocml files.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2012/02/jquery-sdocml-not-working-in-aptana-studio-3-for-eclipse/feed/ 0
Resizing an Appcelerator WebView accordingly to it’s content (YOC Ads) https://jqueryplugins.info/2012/02/resizing-an-appcelerator-webview-accordingly-to-its-content-yoc-ads/ https://jqueryplugins.info/2012/02/resizing-an-appcelerator-webview-accordingly-to-its-content-yoc-ads/#comments Wed, 22 Feb 2012 13:15:17 +0000 Admin https://jqueryplugins.info/2012/02/resizing-an-appcelerator-webview-accordingly-to-its-content-yoc-ads/ Post link: Resizing an Appcelerator WebView accordingly to it’s content (YOC Ads)

We are currently in the process of adding ads from YOC and smartadserver.com to an iPhone and Android App we develop with Appcelerator Titanium. Now we would like to embed...

]]>
Post link: Resizing an Appcelerator WebView accordingly to it’s content (YOC Ads)

We are currently in the process of adding ads from YOC and smartadserver.com to an iPhone and Android App we develop with Appcelerator Titanium.

Now we would like to embed the JavaScript calls from the YOC/smartadserver JS SDK in a Webview, here I’m looking for the best approach.Until now I do this with the help of jQuery and some kind of listener, which is called every 100 ms. It look at all children (tags) of the body, what the highest and broadest values are and after that it calls a Titanium function which tries to adjust (accordingly to the changes of the ad html) the WebView in the app. It works actually quite good, but maybe there are other more elegant solutions. I had seen that there are several JS variables that I could possibly also check whether there were changes in size or a click event.
And i may not get a feedback of some Ads which open up a new window and also get
a new height and width because of that.
So that’s why I’m looking for the ideal variant. Any help or suggestions would be highly appreciated.

Here are 2 links to the functions that I use:

Here is the function which creates the WebView and the close button:
http://pastie.org/3428595

That’s the content of the WebView:
http://pastie.org/3428600

Thanks,
Marco

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2012/02/resizing-an-appcelerator-webview-accordingly-to-its-content-yoc-ads/feed/ 0