创建两个对象Highslide

时间:2016-08-30 16:23:51

标签: javascript jquery html highslide

我遇到了问题。我同时在highslide创建两个对象,但其中一个没有激活(我无法关闭或移动他)。下面我写一些例子:

hs.graphicsDir = 'http://highslide.com/highslide/graphics/';
hs.outlineType = 'rounded-white';

function paint(id){
   	
	var element = document.getElementById('highslide-html_' + id);
	var frame = hs.htmlExpand(element, { contentId: 'highslide-html_' + id });
	return frame;
}

paint("id1");
paint("id2");
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript" src="http://highslide.com/highslide/highslide.js.php?full=true"></script>
<link rel="stylesheet" type="text/css" href="http://highslide.com/highslide/highslide.css" />


<div class="highslide-html-content highslide-move" id="highslide-html_id1">
	<div class="highslide-header">
		<ul>
			<li class="highslide-close">
				<a href="#" onclick="return hs.close(this)">Close</a>
			</li>
		</ul>
	</div>
	<div class="highslide-body">
		Panel 1
	</div>
    <div class="highslide-footer">
        <div>
            <span class="highslide-resize" title="Resize">
                <span></span>
            </span>
        </div>
    </div>
</div>

<div class="highslide-html-content highslide-move" id="highslide-html_id2">
	<div class="highslide-header">
		<ul>
			<li class="highslide-close">
				<a href="#" onclick="return hs.close(this)">Close</a>
			</li>
		</ul>
	</div>
	<div class="highslide-body">
		Panel 2
	</div>
    <div class="highslide-footer">
        <div>
            <span class="highslide-resize" title="Resize">
                <span></span>
            </span>
        </div>
    </div>
</div>

仅当我一次创建两个对象时它才起作用。如果我将paint(...)放入onclick处理程序,我可以创建任意数量的对象,它们都将是交互式的。

也许有人可以帮助我?

1 个答案:

答案 0 :(得分:1)

哦,我找到了解决方案。

必要时添加hs.allowSimultaneousLoading = true;