Solved

jquery event

Posted on 2013-10-27
7
192 Views
Last Modified: 2013-11-28
Hi Experts,

I would ask how to set and catch tab click even using jquery.
Need working example.

Thanks a lot.
0
Comment
Question by:fpoyavo
7 Comments
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39603560
Hi,
what type of tab are you refering to?
A jQuery UI tab or the tab of the browser?
0
 
LVL 32

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39605677
try this:

<body>
<input type="text" id="myInput">
<script type="text/javascript">
    var myInput = document.getElementById("myInput");
    if(myInput.addEventListener ) {
        myInput.addEventListener('keydown',this.keyHandler,false);
    } else if(myInput.attachEvent ) {
        myInput.attachEvent('onkeydown',this.keyHandler); /* damn IE hack */
    }

    function keyHandler(e) {
        var TABKEY = 9;
        if(e.keyCode == TABKEY) {
            this.value += "    ";
            if(e.preventDefault) {
                e.preventDefault();
            }
            return false;
        }
    }
</script>
</body>

Open in new window

0
 
LVL 1

Author Comment

by:fpoyavo
ID: 39606498
Big_Daddy

I asked for jquery tabs click event not TAB key on keyboard.

Thanks.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 32

Expert Comment

by:Big Monty
ID: 39606705
nothing in your original question do you mention jQuery tabs, please be more specific when you're asking questions...

try this:
 $("#tabName" ).tabs({                                                                  
            activate:function(event,ui){                                                       
                            alert(ui.index);                                                   
                    }                                                                          
         });   

Open in new window


this will work for jquery ui 1.10.* or higher
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39684161
I've requested that this question be closed as follows:

Accepted answer: 500 points for The_Big_Daddy's comment #a39606705

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 39684160
So why the heck I canot post new questions ? Why you charge me and blocking from asking ?
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now