Created
March 6, 2012 14:57
-
-
Save jwrubel/1986681 to your computer and use it in GitHub Desktop.
swf_tag syntax in slim (should work for haml too)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= swf_tag "name_of_swf", \ | |
options={:dom_id => "dom_element", \ | |
:size => "320x240", :version => "10.1", \ | |
:flashvars => {"a" => "test"}, \ | |
:params => {"menu" => "false", "wmode" => "direct"}, \ | |
:attributes => { "align" => "left", "class" => "flash_css_class" }} | |
div(id="dom_element") |
This doesn't appear to be working in Firefox.
http://www.codezen.com/2009/03/swfobject-firefox-and-blank-screens-oh.html
You can use the attributes parameter to pass in a class. if that class has a width/height set, this does work in firefox.
Code updated with @joepage 's feedback and syntax. If you are using this gist in your own code you need to replace the name_of_swf
with the filename (obviously) and the dom_id
parameter with the element you want to contain the swfobject. In the attributes hash, the class
parameter needs to match a css class to style the swf embed. To work around the FF issue mentioned you need to have width and height properties associated with this CSS class.
Any suggestions on what that width and height should be?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can write the div like this: div#dom_element