简体   繁体   English

设置sIFR 3样式时,何时应使用JavaScript / CSS / Flash?

[英]When styling sIFR 3, When should I use JavaScript/CSS/Flash?

I'm using sifr for the first time today. 我今天是第一次使用sifr。 I have it up and running; 我已经启动并运行它; however, I need some help. 但是,我需要一些帮助。 Rather than explain, I'll show you the code below: 除了解释,我将向您显示以下代码:

<div id="pullquote">“Fantastic property, facilities and location. We
      couldn’t have asked for more!” <em>Mr &amp; Mrs. Smith</em></div>

So far, so good. 到现在为止还挺好。 I have then styled that in the same document in case flash/JavaScript is disabled. 然后在同一文档中设置样式,以防Flash / JavaScript被禁用。 No problem. 没问题。

sIFR.replace(journal, {
  selector: 'div#pullquote',
  wmode: 'transparent',
  css: [
    '.sIFR-root { text-align: center; color: #be7705; font-size: 30px; background-color:#fdefd4; }',
    'em { font-style: normal; color: #1d5d69; font-size: 26px; }']
});

That's what is included in my JavaScript file. 那就是我的JavaScript文件中包含的内容。 Am I correct in styling the element like this? 我对这样的元素样式正确吗? I got slightly confused with the selector, then using a second selector within js-css . 我对选择器有些困惑,然后在js-css使用了第二个选择器。 Once again, there is also sifr.css . 再一次,还有sifr.css What should be included in this document? 该文件应包含什么内容? Should I be styling the element here? 我应该在这里样式化元素吗?

I suppose my question is: What should be included, and what styling should be done in sifr-config.js and what styling should be done in sifr.css ? 我想我的问题是:什么应该被包括在内,什么造型应该做sifr-config.js ,什么造型应该做sifr.css

Thank you :) 谢谢 :)

In the CSS for the HTML page ( sifr.css ) you can add a style to hide the elements that sIFR will replace before does so, and you can do some tuning of the text so the text size maps better to the Flash font. 在HTML页面的CSS( sifr.css )中,您可以添加样式以隐藏sIFR之前要替换的元素,并且可以对文本进行一些调整,以使文本大小更好地映射到Flash字体。

The selector parameter for sIFR.replace() is used to select the elements you wish to replace by sIFR. sIFR.replace()selector参数用于selector sIFR.replace() sIFR替换的元素。

The css parameter contains the CSS used inside the Flash movie. css参数包含Flash电影中使用的CSS。 At this point, all CSS selectors are relative to the element you replaced, so if you replace an h1#foo , then you select em rather than h1#foo em . 此时,所有CSS选择器都相对于您替换的元素,因此,如果替换h1#foo ,则选择em而不是h1#foo em This is the only place you can style the text inside the Flash movie, aside from font size, which, if not specified here, is derived from the font size of the replaced element. 除了字体大小,这是唯一可以在Flash电影中设置文本样式的地方,字体大小(如果未在此处指定,则源自替换元素的字体大小)。

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

相关问题 选中复选框时使用JavaScript访问CSS样式 - Accessing CSS styling with JavaScript when checkbox is checked 我什么时候应该使用javascript框架库? - When should I use a javascript framework library? 我什么时候应该在 Javascript 中将函数用作类? - When should I use functions as classes in Javascript? 我什么时候应该在JavaScript中使用“prototype” - When should I use “prototype” in JavaScript 我什么时候应该在JavaScript中使用MVC框架? - When should I use an MVC framework in JavaScript? CSS / JavaScript:设置画布样式时的问题(用于鼠标绘制) - CSS/JavaScript: issue when styling canvas (for mouse drawing) 什么时候应该在JavaScript / TypeScript中使用`export default`? - When should I use `export default`in JavaScript / TypeScript? HTML / Javascript和Web服务-什么时候应该使用表格? - HTML/Javascript and Web Services - When should I use a form? 在 Javascript 中检查 undefined&#39;ness 时,我应该使用 != 还是 !==? - When checking for undefined'ness in Javascript, should I use != or !==? JavaScript中的MVC:在实例化这三个实体时是否应该使用回调? - MVC in javascript : Should i use callback when instantiating the three entities?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM