Opened 14 years ago
Closed 14 years ago
#2257 closed defect (worksforme)
Slideshow does not function when instantiated using createWidget
Reported by: | guest | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Widgets | Version: | 0.4.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I am trying to use the createWidget javascript function with the SlideShow? widget so I can dynamically change content. The first image loads and then… nothing. Trying to toggle the play/pause does nothing. Simplified reproduction test case below. By the way, the same parameters used with a hardcoded tag work properly.
===================================================
<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01EN"
<html>
<head>
<title>Slideshow Widget Demo</title>
<script type="text/javascript"> var djConfig = {isDebug: true}; </script>
<script type="text/javascript" src="js/dojo.js"></script>
<script language="JavaScript?" type="text/javascript">
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.SlideShow?");
</script>
<style>
html, body {
height: 100%; width: 100%;
overflow: hidden;
}
</style>
</head>
<body>
<div id="testSS">
<script type="text/javascript">
dojo.widget.createWidget("SlideShow?",
{id:"ss1",imgUrlBase:"images/",imgUrls:["1.jpg","2.jpg","3.jpg"," 4.jpg"],transitionInterval:'700',src:"1.jpg",delay:'3000',imgWidth:'480',imgHeight:'250'}, document.getElementById("testSS"));
</script>
</div>
</body>
</html>
Attachments (1)
Change History (4)
Changed 14 years ago by
Attachment: | test_SlideShow.html added |
---|
comment:1 Changed 14 years ago by
It works if you write transitionInterval:700 in your constructor instead of transitionInterval:'700', because this.transitionInterval is an Integer.
Bye!
Nicola
comment:2 Changed 14 years ago by
Confirmed that changing this parameter works. I can see how the width and height params might need to be strings (to account for "px" or "%" dimensions), but wouldn't there be the same issue with the delay param? It seems to work fine as a stringified argument. Just a thought. From my perspective, I consider the matter resolved.
comment:3 Changed 14 years ago by
Milestone: | → 0.9 |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
The test case