Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing easySlider1.7, Hindering another JavaScript Function
    primarykey
    data
    text
    <p>I am using easyslider1.7 jquery plugin to produce the scrollable slider effect. Below is my HTML in which I am using the plugin to produce the effect. </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;link rel="stylesheet" type="text/css" href="/NotificationLayout/css/CSS1.css"/&gt; &lt;link rel="stylesheet" type="text/css" href="/NotificationLayout/css/screen.css"/&gt; &lt;script type="text/javascript" src="../JS/Base.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="../JS/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="../JS/easySlider1.7.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#slider").easySlider({ continuous: true }); }); &lt;/script&gt; &lt;title&gt;Realtime Notification Panel&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;/head&gt; &lt;body class="bodycustom1"&gt; &lt;iframe id="NotificationIframe" name="NotificationIframe" src="Notifications.html" seamless&gt; &lt;/iframe&gt; &lt;br&gt; &lt;div id="content"&gt; &lt;div id="slider"&gt; &lt;ul&gt; &lt;li&gt; &lt;font onclick="changeIframeSrc('Notifications.html')"&gt;All&lt;/font&gt;&amp;emsp;&amp;emsp; &lt;img src="../icons/Alfresco.png" id="Alfresco" alt="Alfresco" onclick="changeIframeSrc('AlfrescoNotificationDeck.html')"/&gt;&amp;emsp;&amp;emsp; &lt;img src="../icons/GoogleCalendar.png" id="GoogleCalendar" alt="GoogleCalendar" onclick="changeIframeSrc('GCalNotificationDeck.html')"/&gt;&amp;emsp;&amp;emsp; &lt;img src="../icons/Linkedin.png" id="Linkedin" alt="LinkedIn" onclick="changeIframeSrc('LinkedInNotificationDeck.html')"/&gt;&amp;emsp;&amp;emsp; &lt;img src="../icons/Rss.png" id="Rss" alt="RSS" onclick="changeIframeSrc('RSSNotificationDeck.html')"/&gt; &lt;br&gt; &amp;emsp;&amp;emsp;&amp;emsp; &lt;img src="../icons/On.png" alt="On" id="one" onclick="toggleType('Alfresco','one');"/&gt;&amp;emsp;&amp;emsp; &lt;img src="../icons/On.png" alt="On" id="two" onclick="toggleType('GoogleCalendar','two');"/&gt;&amp;emsp;&amp;emsp; &lt;img src="../icons/On.png" alt="On" id="three" onclick="toggleType('Linkedin','three');"/&gt;&amp;emsp;&amp;emsp; &lt;img src="../icons/On.png" alt="On" id="four" onclick="toggleType('Rss','four');"/&gt; &lt;/li&gt; &lt;li &gt; &lt;img src="../icons/Salesforce.png" id="Salesforce" alt="Salesforce" onclick="changeIframeSrc('SFNotificationDeck.html')"/&gt;&amp;emsp;&amp;emsp; &lt;img src="../icons/Sharepoint.png" id="Sharepoint" alt="Sharepoint" onclick="changeIframeSrc('SPNotificationDeck.html')"/&gt;&amp;emsp;&amp;emsp; &lt;img src="../icons/Connections.png" id="Connections" alt="IBM Connections" onclick="changeIframeSrc('IBMConnNotificationDeck.html')"/&gt; &lt;br&gt; &lt;img src="../icons/On.png" alt="On" id="five" onclick="toggleType('Salesforce','five');"/&gt;&amp;emsp;&amp;emsp; &lt;img src="../icons/On.png" alt="On" id="six" onclick="toggleType('Sharepoint','six');"/&gt;&amp;emsp;&amp;emsp; &lt;img src="../icons/On.png" alt="On" id="seven" onclick="toggleType('Connections','seven');"/&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p></p> <p>I have written a javascript method to toggle the images from on to off and vice versa, and also changing the image of particular notification type. By clicking on the On button in the above HTML, two changes should happen On button should change to Off button. And the border of image above it should changes to a red border image. VIce Versa for Off button.</p> <pre><code>function toggleType(channelType,button){ var type=document.getElementById(channelType); var polarity=document.getElementById(button); var situation=polarity.alt; if(situation=="On"){ type.src="../icons/"+channelType+"RB.png"; type.style.cursor="auto"; polarity.src="../icons/Off.png"; polarity.alt="Off"; }else if(situation=="Off"){ type.src="../icons/"+channelType+".png"; type.style.cursor="pointer"; polarity.src="../icons/On.png"; polarity.alt="On"; } } </code></pre> <p>The problem is my javascript function produce desirable results for the first 4 images that are in first li element. But when I slide to the next set of images in the other li element, my javascript function stops working. It does not changes image and toggles on and off button. </p> <p>Please help me with it. I am new to jquery.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload