简体   繁体   English

如果javascript被禁用,jquery同位素的后备?

[英]fallback for jquery isotope if javascript is disabled?

Is there a fallback for jQuery isotope if JavaScript is disabled? 如果JavaScript被禁用,是否有jQuery同位素的后备?

Suppose if I m using there fitColumns property, is there a fallback to that layout style if JavaScript is disabled, like what u have in d new myspace . 假设我在那里使用了fitColumns属性,如果禁用了JavaScript,那么是否会回退到该布局样式,就像你在新的myspace中所拥有的那样。
the initial posts, which appears on your myspace home page, will be styled properly but no additional post will load when you further scroll. 显示在您的myspace主页上的初始帖子将被正确设置样式,但是当您进一步滚动时不会加载其他帖子。
What kind of CSS structure or fallback methodology can be used for such situations? 什么样的CSS结构或回退方法可以用于这种情况?

If JavaScript is disabled and if you want to keep the elements positioned nicely like as if the jQuery Isotope is doing its job then you can only rely on CSS. 如果JavaScript被禁用,并且如果你想保持元素定位很好,就好像jQuery Isotope正在做它的工作那么你只能依赖CSS。 That would mean you would have to manually position those elements in the order that you want. 这意味着你必须按照你想要的顺序手动定位这些元素。

If you're OK with that then follow these steps below to start: 如果您对此没问题,请按照以下步骤开始:

  1. Put a class name on the main wrapper of your Isotope elements such as off . 将类名放在Isotope元素的主包装上,例如off For example: <div id="isotope-container" class="isotope off"> 例如: <div id="isotope-container" class="isotope off">
  2. Start positioning your elements manually and include .off as one of the selectors. 手动开始定位元素,并将.off作为选择器之一。 For example: .isotope.off .isotope-element-1 { position:absolute; top: 10px; left: 10px; } 例如: .isotope.off .isotope-element-1 { position:absolute; top: 10px; left: 10px; } .isotope.off .isotope-element-1 { position:absolute; top: 10px; left: 10px; } .isotope.off .isotope-element-1 { position:absolute; top: 10px; left: 10px; } .isotope.off .isotope-element-2 { position:absolute; top: 10px; left: 100px; } .isotope.off .isotope-element-1 { position:absolute; top: 10px; left: 10px; } .isotope.off .isotope-element-2 { position:absolute; top: 10px; left: 100px; } .isotope.off .isotope-element-2 { position:absolute; top: 10px; left: 100px; }
  3. Then on your general jquery file where you have all other stuff written on, check if .off class exists and if it does, remove it. 然后在你的一般jquery文件中,你写了所有其他的东西,检查.off类是否存在,如果存在,删除它。 For example: if($('#isotope-container.isotope').hasClass('off')){ $('#isotope-container.isotope').removeClass('off'); } 例如: if($('#isotope-container.isotope').hasClass('off')){ $('#isotope-container.isotope').removeClass('off'); } if($('#isotope-container.isotope').hasClass('off')){ $('#isotope-container.isotope').removeClass('off'); }

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM