Code: Select all
<script type="text/javascript">
hs.addEventListener(window, "load", function() {
hs.expand(null, {
src: 'image.jpg'
});
});
</script>
A second method - if you want to open an existing anchor - is to assign an id to it then virtually click it.
1) Define the opening anchor like you normally would, and assign an id to it.
Image expander:
Code: Select all
<a id="autoload" href="img.jpg" onclick="return hs.expand(this)">
Code: Select all
<a id="autoload" href="page.htm" onclick="return htmlExpand(this, { objectType: AJAX })">
Code: Select all
<script type="text/javascript">
hs.addEventListener(window, "load", function() {
// click the element virtually:
document.getElementById("autoload").onclick();
});
</script>