A cleaner way to embed slides - shorter code and a clickable preview

9 views
Skip to first unread message

Chris Heilmann

unread,
Apr 18, 2008, 2:02:46 AM4/18/08
to SlideShare Developers
I bounced this idea off some people at the San Francisco JavaScript
meeting. I've written a small script that allows you to use a shorter
embed code. Instead of the rather verbose:

<div style="width:425px;text-align:left" id="__ss_335941">
<object style="margin:0px" width="425" height="355">
<param name="movie" value="http://static.slideshare.net/swf/
ssplayer2.swf?doc=highlandflingbadgesnew-1207296687342384-9"/>
<param name="allowFullScreen" value="true"/>
<param name="allowScriptAccess" value="always"/>
<embed src="http://static.slideshare.net/swf/ssplayer2.swf?
doc=highlandflingbadgesnew-1207296687342384-9" type="application/x-
shockwave-flash" allowscriptaccess="always" allowfullscreen="true"
width="425" height="355"></embed>
</object>
<div style="font-size:11px;font-family:tahoma,arial;height:
26px;padding-top:2px;"><a href="http://www.slideshare.net/?
src=embed"><img src="http://static.slideshare.net/swf/logo_embd.png"
style="border:0px none;margin-bottom:-5px" alt="SlideShare"/></a>
| <a href="http://www.slideshare.net/cheilmann/building-badges-for-
distribution-335941?src=embed" title="View 'Building Badges for
distribution' on SlideShare">View</a> |
<a href="http://www.slideshare.net/upload?src=embed">Upload your own</
a>
</div>
</div>

You can use


<div class="slideshare">
<a href="http://www.slideshare.net/cheilmann/building-badges-for-
distribution-335941#highlandflingbadgesnew-1207296687342384-9">View
'Building Badges for distribution' on SlideShare</a>
<script src="http://chrisslidesharehacks.googlecode.com/files/
previewer.js"></script>
</div>

This means people without Flash or JavaScript get a normal link and
your pages don't slow down as much when you have a lot of slide
embeds.

There's a converter to the shorter format at:
http://icant.co.uk/sandbox/slideshareconverter.html

The whole code is also available at: http://code.google.com/p/chrisslidesharehacks/downloads/list

enjoy,

Chris




http://www.wait-till-i.com/2008/04/17/hacking-slideshare-embed/
Reply all
Reply to author
Forward
0 new messages