简体   繁体   English

我想将页面上的Flash元素转换为javascript / jquery ...?

[英]I want to turn this flash element on my page into javascript/jquery…?

http://floorsofstone.com/sample-request/ http://floorsofstone.com/sample-request/

^ The table with stone samples on is the element in question. ^上面装有石材样品的桌子是有问题的元素。

How would I even go about describing this so I can find a javascript/jquery alternative to make it easily editable. 我什至会去描述它,所以我可以找到一个javascript / jquery替代方案以使其易于编辑。

If anybody has anything similar please pass on the link... 如果有人有相似之处,请通过链接...

Thanks very much. 非常感谢。

I could tell you it is possible to do something like that, I don't think you would find an out-of-the-box plugin to handle everything for you. 我可以告诉您,可以执行类似的操作,但我认为您不会找到一个开箱即用的插件来为您处理所有事情。

You would have to have a grid of divs with all your tiles. 您将必须拥有一个包含所有图块的div网格。

  • Hook each of the div's (per tile) to a mouseover, mouseout and click events. 将每个div(每个图块)钩到鼠标悬停,mouseout和click事件上。
  • On click hide /remove the element from the main grid 单击时,从主网格中隐藏 /删除元素
  • Show it in the selection. 在选择中显示它。

I would think it would be better to do the whole thing without any animations first. 我认为最好在没有任何动画的情况下完成整个操作。

Then you can add animated effects to make it all look better. 然后,您可以添加动画效果以使其看起来更好。 Look at JQuery's animate and JQueryUI animation for the little mouse over effects. 查看JQuery的动画JQueryUI动画 ,以了解鼠标悬停的效果。

Update: Once you are done creating your client behavior (selection..et) and animations. 更新:完成创建客户端行为(selection..et)和动画的操作。 You can then hook the whole thing up to your server with jquery.ajax() 然后,您可以使用jquery.ajax()将整个事情挂接到服务器上

I checked out how that page works. 我检查了该页面的工作方式。 On submit, it loads up a form for some details and posts the data off to this url : http://floorsofstone.com/sample-request/post-data.aspx 提交后,它将加载一些详细信息的表单,并将数据发布到以下URL: http : //floorsofstone.com/sample-request/post-data.aspx

The popup dialog also contains hidden fields with the selected TileID's, something like this: 弹出对话框还包含带有选定TileID的隐藏字段,如下所示:

<input id="TileIDs" type="hidden" value="4005,4004,4003,4002," name="TileIDs">
<input id="Tile1" type="hidden" value="Adobe Quarry Tile" name="Tile1"> 
<input.....

So your jquery on submit would be something like: 因此,您提交的jQuery类似于:

$.ajax({
  type: "POST",
  url: "/sample-request/post-data.aspx",
  data:"TileIDs=" + $("#TileIDs").val() + "&ClientName=" + $("#ClientName").val()
  //the "TileIDs"= is the name your server expects and 
  //#TileID is the id of the html field that contains the value 
  }).done(function( msg ) 
     {
      alert( "Data Saved: " + msg );
     });

Personally, I wouldn't use javascript or jquery for this. 就个人而言,我不会为此使用javascript或jquery。

I would go with CSS3 transitions. 我会使用CSS3过渡。 When you hover over a div, the tile-image should shrink, with css3 transitions, we can do that in an animated fashion. 当您将鼠标悬停在div上时,磁贴图像应会缩小,并带有css3过渡,我们可以采用动画方式进行此操作。

HTML 的HTML

<div class="tile">
  <span>sometext</span>
  <img src="tile-1.jpg">
</div>

CSS 的CSS

.tile {
  width: 100px;
  height: 100px;
}

.tile img {
  width: 100px;
  height: 100px;
  -webkit-transition: all 1s ease-in-out;
  -moz-transition: all 1s ease-in-out;
  -o-transition: all 1s ease-in-out;
  -ms-transition: all 1s ease-in-out;
  transition: all 1s ease-in-out;
}

.tile:hover img {
  width: 80px;
  height: 80px;
}

NOTE: I haven't tested this, but I think it should be fine. 注意:我尚未对此进行测试,但我认为应该没问题。

NOTE 2: this doesn't work in IE 9 and lower. 注意2:这在IE 9及更低版本中不起作用。 In this example, I personally wouldn't mind that IE doesn't have the nice transition. 在此示例中,我个人不介意IE没有很好的过渡。 If you really must, test for css3 transitions with Modernizr , and provide a jquery fallback. 如果确实需要,请使用Modernizr测试css3过渡,并提供一个jQuery后备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果我想让我的网站跨平台兼容和屏幕阅读器兼容,我应该避免使用javascript,jquery,flash,ajax,silverlight吗? - Should I avoid javascript , jquery, flash, ajax, silverlight if i want to make my site cross platform compatible and screen reader compatible? 我想用jquery或javascript获取元素的高度 - I want to get the height of an element with jquery or javascript 根据页面上的SWF(flash)元素创建图像? PHP / jQuery / Javascript / HTML / FLASH - Create image based off a SWF (flash) element on the page? PHP/Jquery/Javascript/HTML/FLASH 我想转到杂志上的特定页面 - I want to turn to a specific page in a magazine 我想把菜单固定在最上面 - I want to turn my menu fixed on top 我想在jQuery和css中为我的菜单项添加一个子元素 - I want to add a sub element to my menu items in jQuery and css Jquery 不会选择我想要的样式并将其添加到我的元素中 - Jquery wont select and add the style i want to my element 我想在不使用jquery的情况下在我的页面上使用文本计数器吗? - I want a text counter to work on my page without using jquery? 我的javascript执行后页面重新加载,我不想要它 - Page reloads after my javascript is executed, I dont want it to 在 Javascript 中,我想在刷新页面后保持滚动位置 - IN Javascript, I want to maintain my scroll location after refreshing the page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM