Java 小程序上的 CSS/JS 光标
我正在开发一个网站,该网站使用 java 小程序来创建餐厅房间的“虚拟游览”。它采用大型全景图像、加载图像和小程序的 .jar 文件并创建小程序。该小程序已经创建用于他们的旧站点,所以我只需重新部署它。
我想在其上使用移动光标而不是默认光标,但我似乎无法使用 JavasSript 或 CSS 样式来影响它。我已经尝试过在 applet 标签、样式表、甚至加载它的 jQuery 中内联。
不确定代码对这个问题有多大用处,但以防万一下面的相关代码片段:
JAVASCRIPT
$(function() {
$(".tourlink a").click(function(e) {
$(".instructions").remove();
e.preventDefault();
var url = $(this).attr("href"),
$target = $("#virtual"),
targetOffset = $target.offset().top,
distance = Math.abs($(this).offset().top - targetOffset);
$target.load(url+" #app", function() {
$('html,body').animate({scrollTop: targetOffset}, 1000 + (distance / 5));
}).before('<p class="center instructions"><strong>Click and drag your mouse to tour the area</strong></p>');
});
});
HTML
<h1>Virtual Tour</h1>
<div style="width:300px; float:right;">
<h2>Evansville</h2>
<ul class="tourlink">
<li><a href="tour/tour.asp?tour=entrance" target="_blank">Entrance</a></li>
<li><a href="tour/tour.asp?tour=large" target="_blank">Large Hibachi</a></li>
<li><a href="tour/tour.asp?tour=small" target="_blank">Small Hibachi</a></li>
<li><a href="tour/tour.asp?tour=sushi" target="_blank">Sushi Bar & Dining Area</a></li>
<li><a href="tour/tour.asp?tour=banquet" target="_blank">Private Dining</a></li>
</ul>
</div>
<div style="width:300px; float:left;">
<h2>Lexington</h2>
<ul class="tourlink">
<li><a href="tour/tour.asp?tour=lexbar" target="_blank">Bar</a></li>
<li><a href="tour/tour.asp?tour=lexsushi" target="_blank">Sushi Bar</a></li>
<li><a href="tour/tour.asp?tour=lexhibachi1" target="_blank">Hibachi 1</a></li>
<li><a href="tour/tour.asp?tour=lexhibachi2" target="_blank">Hibachi 2</a></li>
</ul>
</div>
APPLET(文件参数根据链接而变化)
<div id="app">
<applet archive="/review/nagasaki-inn/tour/ptviewer.jar" code="ptviewer.class" width="700" height="480">
<param name="file" value="/review/nagasaki-inn/tour/large.jpg" />
<param name="wait" value="/review/nagasaki-inn/tour/naglogo.jpg" />
</applet>
</div><!--app-->
I'm working on a website that uses a java applet to create a "virtual tour" of a room for a restaurant. It takes a large panoramic image, a loading image, and the applet's .jar file and creates the applet. The applet was already created in use for their old site, so I just get to redeploy it.
I want to use a move cursor on it instead of the default cursor, but I can't seem to affect it with either JavasSript or CSS styling. I've tried inline on the applet tag, in the style sheet, and even in the jQuery that loads it.
Not sure how useful the code would be to this question, but just in case relevant snippets of code below:
JAVASCRIPT
$(function() {
$(".tourlink a").click(function(e) {
$(".instructions").remove();
e.preventDefault();
var url = $(this).attr("href"),
$target = $("#virtual"),
targetOffset = $target.offset().top,
distance = Math.abs($(this).offset().top - targetOffset);
$target.load(url+" #app", function() {
$('html,body').animate({scrollTop: targetOffset}, 1000 + (distance / 5));
}).before('<p class="center instructions"><strong>Click and drag your mouse to tour the area</strong></p>');
});
});
HTML
<h1>Virtual Tour</h1>
<div style="width:300px; float:right;">
<h2>Evansville</h2>
<ul class="tourlink">
<li><a href="tour/tour.asp?tour=entrance" target="_blank">Entrance</a></li>
<li><a href="tour/tour.asp?tour=large" target="_blank">Large Hibachi</a></li>
<li><a href="tour/tour.asp?tour=small" target="_blank">Small Hibachi</a></li>
<li><a href="tour/tour.asp?tour=sushi" target="_blank">Sushi Bar & Dining Area</a></li>
<li><a href="tour/tour.asp?tour=banquet" target="_blank">Private Dining</a></li>
</ul>
</div>
<div style="width:300px; float:left;">
<h2>Lexington</h2>
<ul class="tourlink">
<li><a href="tour/tour.asp?tour=lexbar" target="_blank">Bar</a></li>
<li><a href="tour/tour.asp?tour=lexsushi" target="_blank">Sushi Bar</a></li>
<li><a href="tour/tour.asp?tour=lexhibachi1" target="_blank">Hibachi 1</a></li>
<li><a href="tour/tour.asp?tour=lexhibachi2" target="_blank">Hibachi 2</a></li>
</ul>
</div>
APPLET (the file param changes depending on the link)
<div id="app">
<applet archive="/review/nagasaki-inn/tour/ptviewer.jar" code="ptviewer.class" width="700" height="480">
<param name="file" value="/review/nagasaki-inn/tour/large.jpg" />
<param name="wait" value="/review/nagasaki-inn/tour/naglogo.jpg" />
</applet>
</div><!--app-->
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我以前使用过一个小程序,特别是使用处理,我只能在应用程序内部使用以下代码更改光标:
I've worked with an applet before, specifically using processing and I could change the cursor only inside the app with code like:
您需要调用 setCursor。
您可以访问 Java 源代码并且可以重新编译它吗?如果您无权访问源代码,您可以反编译 Applet 类并重新编译,但请注意,如果这是第三方代码,则可能违反许可证。
You need to call setCursor on the component within the Java applet source code.
Do you have access to the Java source and can you recompile it? If you don't have access to the source it may be possible for you to decompile the Applet class and recompile but beware if this is third party code this may be against the license.