Opened 13 years ago

Closed 12 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"

"http://www.w3.org/TR/html4/strict.dtd">

<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)

test_SlideShow.html (945 bytes) - added by guest 13 years ago.
The test case

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by guest

Attachment: test_SlideShow.html added

The test case

comment:1 Changed 13 years ago by nicola.rizzo+dojo@…

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 13 years ago by craig dunn (original issue poster)

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 12 years ago by dylan

Milestone: 0.9
Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.