<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lotushints &#187; jQuery</title>
	<atom:link href="http://www.lotushints.com/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lotushints.com</link>
	<description>Lotus Notes tips &#38; tricks you always hoped you will not need</description>
	<lastBuildDate>Thu, 29 Dec 2011 09:47:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>JQuery, AJAX and IE</title>
		<link>http://www.lotushints.com/2009/10/jquery-ajax-and-ie/</link>
		<comments>http://www.lotushints.com/2009/10/jquery-ajax-and-ie/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 07:00:30 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[$.get]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=449</guid>
		<description><![CDATA[On our FlipIT service web page, we experienced an interesting problem. There is a &#8220;Did you know&#8221; (DYK) section that refreshes upon clicking the link. Behind all that is an AJAX created with JQuery $.get method. All normal thus far. Until IE steps into the picture. I don&#8217;t know if the same behaviour is in [...]]]></description>
			<content:encoded><![CDATA[<p>On our <a href="http://www.flipit.si" target="_blank">FlipIT service web page</a>, we experienced an interesting problem. There is a &#8220;Did you know&#8221; (DYK) section that refreshes upon clicking the link. Behind all that is an AJAX created with <a href="http://www.jquery.com" target="_blank">JQuery</a> <strong>$.get</strong> method. All normal thus far.</p>
<p>Until IE steps into the picture. I don&#8217;t know if the same behaviour is in IE 8 as well, but IE 7 definitely has issues with AJAX requests. If URL of request doesn&#8217;t change, IE caches the result and passes it back to you. This wouldn&#8217;t be a problem if you would actually expect to see the same result each and every time. However, in our case, where it is desired that DYK section is not always the same, this is kind of annoying.</p>
<p>To sort out our issues, we just added a random number to the request. This number is changed to new random value each and every time the request is processed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/10/jquery-ajax-and-ie/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Banner animator v1.1</title>
		<link>http://www.lotushints.com/2009/03/banner-animator-v11/</link>
		<comments>http://www.lotushints.com/2009/03/banner-animator-v11/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 08:00:30 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Basic]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[animator]]></category>
		<category><![CDATA[banner]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=276</guid>
		<description><![CDATA[In order to display multiple banners in single spot (and to keep web site from becoming tacky), you will need some sort of client side script that will display first one banner, then the second one etc. This is called banner animator (or even ad animator). In this case, the functionality is written in JavaScript, [...]]]></description>
			<content:encoded><![CDATA[<p>In order to display multiple banners in single spot (and to keep web site from becoming tacky), you will need some sort of client side script that will display first one banner, then the second one etc. This is called banner animator (or even ad animator). In this case, the functionality is written in JavaScript, with some help of HTML (for element positioning) and CSS (for element appearance).<br />
<span id="more-276"></span><br />
<strong>What does that have to do with Lotus Notes?</strong></p>
<p>Absolutely nothing. The only connection to Lotus Notes is, when you integrate this functionality into your database. It is a simple and trivial solution. I needed to create a form that will represent one single banner. This form contains name, URL, image, sort order etc. Look-up view for obtaining sorted banner list was created and some web forms that are already in &#8220;production&#8221; had to be altered, for loading of JavaScript class etc.</p>
<p><strong>Prerequisites</strong></p>
<p>This functionality depends heavily on <a href="http://jquery.com/">jQuery library</a>. It can be obtained <a href="http://docs.jquery.com/Downloading_jQuery">here</a>. I recommend minified version if you plan on hosting it yourself or, you can use <a href="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js">Google Code link</a> to link it from Google.</p>
<p>Next you need to obtain the <em>adPlayer </em>library. It is located <a href="http://dl.getdropbox.com/u/599331/jslibs/adPlayer.js">here</a>. I would ask you to not link the library directly from this link, but download it to your server and link it from there.</p>
<p><strong>Getting started</strong></p>
<p>In order to implement this application, you will first need to make a small HTML adjustment in the place where you want banner animator to be implemented.</p>
<pre>&lt;ul id="adPlayer"&gt;
    &lt;li&gt;&lt;a href=""&gt;&lt;img src="images/ad1.jpg" /&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=""&gt;&lt;img src="images/ad2.jpg" /&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=""&gt;&lt;img src="images/ad3.jpg" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div id="adPlayerNav"&gt;&lt;/div&gt;</pre>
<p>Obviously you should insert link of your desire. The same goes for image <em>src </em>and <em>alt</em> parameters. Also, number of <em>li</em> elements can vary.</p>
<p>Next, at the bottom of the page (where your JS libraries are loaded and on load events are set), you need to load both .js files  (<em>jQuery </em>and <em>AdPlayer</em>) , if you do not already have them. Next, add following (or if you already have onload event loader, just call loadPlayer() function).</p>
<pre>&lt;script type="text/javascript" language="javascript"&gt;
    $(document).ready(function() {
        loadPlayer();
    });
&lt;/script&gt;</pre>
<p><strong>Now add some style<br />
</strong></p>
<p>It is necessary to add styling to content thus far. CSS excerpt below will give you some idea as to how you can style things. Beware that #adPlayer height property must be set to height of a banner space. Also, some tweaking to .js file will have to be done, but nothing major (this will definitely be changed in future releases).</p>
<pre>/* layout */
#adPlayer { list-style: none; height: 220px; margin-left: 0;
margin-bottom: 0; overflow: hidden; padding: 0; }
#adPlayer li { margin: 0; padding: 0; }
#adPlayerNav { position: relative; top: -1em; right: 1em;
text-align: right; }
#adPlayerNav ul { list-style: none; margin: 0; padding: 0; }
#adPlayerNav li { display: inline; margin: 0 0 0 0.1em;
padding: 0; }
#adPlayerNav li.adPlay, #adPlayerNav li.adPause {
margin-left: 1em; }
#adPlayerNav li a { cursor: pointer; padding: 0 0.5em; }

/* typography */
#adPlayerNav li { font-size: 1.2em; }

/* color */
#adPlayerNav li { border: solid 1px rgb(213, 213, 217); }
#adPlayerNav li a { background-color: white; padding: 0.5em; }</pre>
<p>You now have fully functional banner animator.</p>
<p><strong>Optimization</strong></p>
<p>Loading 3+ 50K+ images in the middle of the page can never be a good thing. Thus, <em>adPlayer</em> library has a <strong>dynamic mode</strong> that can be used. This mode loads images after the page is loaded, which is a good thing. However, you cannot leave your banner space empty until then. A compromise solution is to load first banner in-line and all others after the document is loaded. Your HTML file must now look somewhat like this:</p>
<pre>...
&lt;ul id="adPlayer"&gt;
    &lt;li&gt;&lt;a href=""&gt;&lt;img src="images/ad1.jpg" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div id="adPlayerNav"&gt;&lt;/div&gt;
...
&lt;script type="text/javascript" language="javascript"&gt;
    $(document).ready(function() {
        loadPlayer( true );
        adplayer.add ("", "images/ad2.jpg", "");
        adplayer.add ("", "images/ad3.jpg", "");
        adplayer.generatePlayer();
    });
&lt;/script&gt;</pre>
<p>Loading <em>loadPlayer</em> method with <em>true </em>as parameter value will enable <strong>dynamic mode</strong>. Now you can add banners in desired sort order. First parameter is <em>link</em>, second image <em>src </em>and third image <em>alt</em>. After you are done, just call <em>generatePlayer</em> method.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/03/banner-animator-v11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

