[library-web] [mallard] duplicate javascript for mouseovers, to position images correctly
- From: Frederic Peters <fpeters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [library-web] [mallard] duplicate javascript for mouseovers, to position images correctly
- Date: Wed, 6 Apr 2011 05:56:40 +0000 (UTC)
commit 2b46f0bf2ac20a9c5a4c133b70313cdc57d7bf18
Author: Frédéric Péters <fpeters 0d be>
Date: Wed Apr 6 11:25:50 2011 +0530
[mallard] duplicate javascript for mouseovers, to position images correctly
data/xslt/mal2html.xsl | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/data/xslt/mal2html.xsl b/data/xslt/mal2html.xsl
index c754a05..7bdea2e 100644
--- a/data/xslt/mal2html.xsl
+++ b/data/xslt/mal2html.xsl
@@ -99,7 +99,39 @@ along with libgo; if not, write to the Free Software Foundation, Inc.,
<xsl:call-template name="html.head.custom"/>
<xsl:call-template name="html.css"/>
<xsl:call-template name="libgo.head"/>
+ <script type="text/javascript" src="/js/jquery.js" />
<link rel="stylesheet" type="text/css" href="/skin/mallard.css"/>
+ <xsl:call-template name="mal2html.facets.js"/>
+ <script type="text/javascript" language="javascript"><xsl:text><![CDATA[
+$(document).ready(function () {
+ $('div.mouseovers').each(function () {
+ var contdiv = $(this);
+ var width = 0;
+ var height = 0;
+ var img = null;
+ contdiv.find('img').each(function () {
+ img = $(this);
+ if ($(this).attr('data-yelp-match') == '')
+ $(this).show();
+ });
+ contdiv.next('ul').find('a').each(function () {
+ var mlink = $(this);
+ console.log('mlink', $(this));
+ mlink.hover(
+ function () {
+ var offset = img.offset();
+ mlink.find('img').css({left: offset.left, top: offset.top, zIndex: 10});
+ mlink.find('img').fadeIn('fast');
+ },
+ function () {
+ mlink.find('img').fadeOut('fast');
+ }
+ );
+ });
+ })
+});
+ ]]></xsl:text></script>
+ <xsl:apply-templates mode="html.js.mode" select="$node"/>
</head>
<body>
<xsl:apply-templates mode="html.body.attr.mode" select="$node"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]