Discuss the articles posted on Dev.Opera.
By operadev
Wednesday, 21. May 2008, 07:25:29
Adding a docked mode to your widgets
( Read the article )
By IceArdor
Sunday, 25. May 2008, 06:25:16

The links in this article are broken for people outside of the LAN.
Post edited Sunday, 25. May 2008, 07:18:12
By moginspace
Wednesday, 18. June 2008, 04:12:16

I am wondering how to add functionality to a button or even a text link to dock the widget.
I have two separate divs, one for widget and one for docked in my index, like the article says.
I have placed the line <widget dockable="yes"> into the config.xml file, like the article says.
I have added all the Javascript to my script/example.js file like the article says.
So now what do I do? I am kind of new with adding active/event listeners and calling them or however they are accessed in javascript. I tried adding something like these to the top of my index.html code but they did not work:
<button onclick="handleDockedMode();">Dock it</button>
then I also tried:
<button onclick="handleModeChange(widgetmodechange);">Dock it</button>
I guess I just would like to know how to code the dockable button portion.
Any assistance is appreciated.
Post edited Wednesday, 18. June 2008, 14:56:47
By Profnovice
Wednesday, 18. June 2008, 13:47:17

Widget emulator - Access denied. ?????????????????????????????????????????????????????????????????
By torbencj
Wednesday, 18. June 2008, 19:06:33
By RainerHillebrand
Friday, 27. March 2009, 09:18:28

I apologise that I did not test your example in the Opera widget emulator. However, I wonder whether this example could really work. My experience is that ...style.display does not work on Opera Mobile, even in version 9.51 Beta (Build 2723). Here is some very simple sample code:
<!DOCTYPE html>
<html>
<head>
<title>Test style.display</title>
<script type="text/javascript">
function handleDockedMode()
{
document.getElementById("widget").style.display = "none";
}
</script>
</head>
<body onload="javascript:handleDockedMode();">
<div id="container">
<div id="widget">This text should be hidden.</div>
<div id="docked">This text should be visible.</div>
</div>
</body>
</html>