Jquery-please explain code

I was researching how to stay in same tab after click  on my code behind button and I came across these 2 possible solutions but
implementing causes a javascript runtime error
'Object expected'

1)          $($respTabs.find('.resp-tab-item.' + options.tabidentify)[tabNum]).addClass('resp-tab-                     active').css({
                'background-color': options.activetab_bg,
                'border-color': options.active_border_color
            });

Open in new window


2)
        $(document).ready(function () {
            $("#HorizontalTab").bind('tabsselect', function (event, ui) {
                window.location.href = ui.tab;
            });
        });

Open in new window


These are jquery codes and maybe the jquery and javaScript experts can help read and implement these correctly what it does. Thanks
zachvaldezAsked:
Who is Participating?
 
Julian HansenCommented:
The first set searches through whatever has been loaded into $respTabs for an element with class
.resp-tab-item.' + options.tabidentify)
This returns an array so the [tabNum] specifies which of the returned elements you are interested in.
To this the class resp-tab-active is added and the CSS background colour and border colour for the selected element are changed

In the second snippet you are binding an event handler to the tabsselect event issued within the element with id #HorizontalTab - and changing the URL of the active window to the tab value passed into the event.

So the first one finds a tab and changes its border and background colour
The second sets the url of the active window to a specified value.
0
 
zachvaldezAuthor Commented:
Thanks! I really need to understand and need to break down further details of it and am confident you can be of tremendous help and thanks more on your patience in advance.
In the example I showed you $respTabs is the  control is?
0
 
Julian HansenCommented:
I am not sure of what you are asking?
0
 
zachvaldezAuthor Commented:
I'm not sure what's $RespTabs is if it is the control object.
0
 
Julian HansenCommented:
You have only provided a small bit of code - in order to answer that question we would need to see where it is defined.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.