When creating jquery functions, how can we determine the correct Koha syntax for various selectors on specific pages? For example, the jquery wiki includes an example that applies to #opac-main-search. But how do we determine the selector for any particular element on any particular Koha page? I'm not sure that I see that FireBug reveals 'opac-main-search' as part of any element's description in the OPAC. Thank you! ===================================== Paul Landers TTUHSC Preston Smith Library paul.landers@ttuhsc.edu<mailto:paul.landers@ttuhsc.edu> 806.743.2220
But how do we determine the selector for any particular element on any particular Koha page? I'm not sure that I see that FireBug reveals 'opac-main-search' as part of any element's description in the OPAC.
I wrote some about that for KohaCon 2009. Jump to the "Fine control with your custom stylesheet" heading on this post: http://www.myacpl.org/koha/?p=160 See if that helps, Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
Owen, this was very helpful for some related questions, but I'm still not sure I understand for to define an element for a specific Koha page. For example, on the query wiki are these 3 examples: $("#memberentry_contact label[for='phone']").html("Primary Phone :"); $("#memberentry_messaging_prefs tr:contains('Upcoming Events')").empty(); $("#patron-messaging-prefs tr:contains('Upcoming Events')").empty(); These seem to be "Koha" elements rather than standard DOM elements. How would I know that, or am I missing something? Thanks! ===================================== Paul Landers TTUHSC Preston Smith Library paul.landers@ttuhsc.edu<mailto:paul.landers@ttuhsc.edu> 806.743.2220 On Aug 14, 2012, at 2:09 PM, Owen Leonard wrote: But how do we determine the selector for any particular element on any particular Koha page? I'm not sure that I see that FireBug reveals 'opac-main-search' as part of any element's description in the OPAC. I wrote some about that for KohaCon 2009. Jump to the "Fine control with your custom stylesheet" heading on this post: http://www.myacpl.org/koha/?p=160 See if that helps, Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
These seem to be "Koha" elements rather than standard DOM elements. How would I know that, or am I missing something?
For the purposes of what you're doing there's no Koha versus "standard DOM." jQuery looks at whatever markup is on the page. When you see this: $("#memberentry_contact label[for='phone']").html("Primary Phone :"); It tells jQuery, "Look for an element on the page with the ID attribute equal to "memberentry_contact." Inside that, find me a <label> with the "for" attribute of "phone." Change the text contents of that <label> to "Primary Phone :" In the example you first quoted, referring to "opac-main-search," there is a <div> on each OPAC page with that ID. If you use Firebug to inspect the blue search bar you should be able to find it in the HTML source. -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
This is exactly the answer I was looking for. Thanks a million! On Aug 16, 2012, at 9:21 AM, Owen Leonard wrote: These seem to be "Koha" elements rather than standard DOM elements. How would I know that, or am I missing something? For the purposes of what you're doing there's no Koha versus "standard DOM." jQuery looks at whatever markup is on the page. When you see this: $("#memberentry_contact label[for='phone']").html("Primary Phone :"); It tells jQuery, "Look for an element on the page with the ID attribute equal to "memberentry_contact." Inside that, find me a <label> with the "for" attribute of "phone." Change the text contents of that <label> to "Primary Phone :" In the example you first quoted, referring to "opac-main-search," there is a <div> on each OPAC page with that ID. If you use Firebug to inspect the blue search bar you should be able to find it in the HTML source. -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
participants (2)
-
Landers, Paul -
Owen Leonard