CSS - Popup Layer (with overlay and close button) - css

I do not know how to describe what I want.
So I did just draw it: http://i.imgur.com/oMFzJ.jpg
This is what I've got so far.
I do not know how to get this overlay
<div id="layer" style="background-color:#212121;border:2px solid #CCCCCC;width:450px;position:absolute;top:20%;left:20%;"> <iframe src="http://www.ebay.com" width="100%" height="300" frameborder="0" scrolling="no"></iframe> <div style="width:100%;"><span style="color:#CCCCCC;float:right;font-size:11px;margin:3px;cursor:pointer;" onclick="document.getElementById('layer').style.display='none';">Close X</span></div> </div>

A quick way to make a modal popup would be to rely on an existing library to accomplish this, consider jQuery UI
In the future please provide more details on what has been tried etc.

I like to use fancybox for my modal popups. The examples on the page use images but you can insert any HTML you'd like.

Related

Responsive class setting iFrame height to 0, resulting in no image displayed

While working on a project, I discovered some of my images on Tumblr are not displaying. The only clue I've found is that within the responsive-level-1 class (see below for html code), the height of the iFrame is set to 0. If I pop open a dev console in Chrome and set that to be, e.g., 1632 (not 0), the image appears. I'm using a theme (Brick theme/theme garden) , but am able to edit the html and css. Can I modify my css and/or HTML to fix this? The issue occurs across device platforms (desktop/phone/tablet).
Example of no image displayed- http://deligrossery.com/post/149661412746/gawad-deli-grocery-207-hart-st-brooklyn-ny
corresponding css files:
responsive.css: http://static.tumblr.com/eftyn9y/kc0og8vio/responsive.css
style.css: static.tumblr.com/3zmswwt/Fmkmwgp8e/style.css
(^ I can't post more than 2 links until my reputation is at least 10/add an https:// to the style.css).
<iframe id="photoset_iframe_149661412746" class="photoset" scrolling="no" frameborder="0" height="0" width="500" style="border:0px; background-color:transparent; overflow:hidden;" src="http://deligrossery.com/post/149661412746/photoset_iframe/deligrossery/tumblr_ocn1e9dTfK1txl3g8/500/false" name="photoset_iframe_149661412746"></iframe>
Try changing your photoset layout block to something like this (you may need to tweak this slightly):
{block:Photoset}
<div class="content photoset">
{block:Photos}
<img src="{PhotoURL-500}"/>
{/block:Photos}
{block:Caption}
<div class="description">{Caption}</div>
{/block:Caption}
<p></p>
</div>
{/block:Photoset}
Keep a backup of your current theme.
This should output the photoset in the normal html template (not iframe). From there it should be much easier to control the height of the content, in fact by default it should just output the content and the height will be fixed automatically. But there might be other issues to investigate after this.

Using CSS in Tumblr Code to Autohide YouTube Player Controls

I have a tumblr with many YouTube video posts. I am wondering how I could use CSS to select the {Video-400} post code and hide the automatic controls that show up on the video.
Here is an example of the automatic controls/visible title I am referring to. They only go away once you play the video: http://jaspingo.tumblr.com/post/105022194129/lol-that-last-one-though.
Also, here are a couple of CSS selectors that might be of use (I don't know the exact differences between them).
#content .video{
}
.video{
}
#content .video iframe{
}
And below is the corresponding HTML.
<div id="content">
<div class="posts">
{block:Posts}
<div class="entry">
{block:Video}
<div class="video">
{Video-400}
</div>
{/block:Video}
</div>
{/block:Posts}
</div>
</div>
Any help would be appreciated. I need to understand the difference between the CSS selectors to fully comprehend the way the code works. And yes, i have tried custom embed code from YouTube, but the same problem exists.
I don't know how Tumblr does their embeds, but you can grab the embed code from YouTube without the controls. A typical embed code looks like:
<iframe width="560" height="315" src="//www.youtube.com/embed/F8Z-ayQkK2A" frameborder="0" allowfullscreen></iframe>
If you want to remove the controls after the fact, you need to add ?controls=0 to the end of the src URL. It becomes:
<iframe width="560" height="315" src="//www.youtube.com/embed/F8Z-ayQkK2A?controls=0" frameborder="0" allowfullscreen></iframe>
To demonstrate, here's the same video using the control parameter outside of an embed code.
The only issue you could run into is with Tumblr using the YouTube API to call the video rather than the embed code. In that case, I'm not sure there's much you can do about it unless you have access to the source and the method for pulling the video into your blog.

How can I fix the indentation in a facebook like-box?

I can go to facebook and get the code for a "like box". Very handy.
Problem is, the display of this box is lame. it's not consistent. The first article in the 'stream' is displayed with this sort of indentation:
The next article in the stream is displayed with different (lame) indentation.
This is in the same likebox, I merely scrolled down.
The effect is not limited to the stream for "Facebook Platform". I've seen it in the Likebox for other streams as well.
I'd like to style the box, to try to make the indentation consistent, but it appears to be rendered as an iframe, which (I think) means I cannot style it because of the S.O.P.
How can I fix this?
Is there a workaround to display a likebox in a div that is not, eventually, an iframe?
EDIT: bug logged: http://developers.facebook.com/bugs/237053466346453
EDIT: I compared the fb:fan control and the likebox control. With the fb:fan thing, it is possible to provide custom CSS to style the contents. (There are some caveats.) I set the width and margins of the text, and also erased the actorName, which is the same for every post. This is the result:
The left side is produced with this code:
<fb:fan profile_id='19292868552' width='292'
connections='0' show_faces='false' stream='true' header='false'
css='http://example.org/fb/customfanbox.css?_=6392'></fb:fan>
The right side is produced with this:
<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&width=292&colorscheme=light&show_faces=false&border_color&stream=true&header=false&height=525"
scrolling="no"
frameborder="0"
style="border:none; overflow:hidden; width:292px; height:525px;"
allowTransparency="true">
For the left-hand-side, if you don't want the fb:fan element, you can use an iframe that points to fan.php, like this:
<iframe src='http://www.facebook.com/plugins/fan.php?connections=0&css=http%3A%2F%2Fexample.org%2Ffb%2Ffb%2Fcustomfanbox.css%3F_%3D0292&id=19292868552&locale=en_US&sdk=joey&stream=true&width=292&height=560'
scrolling="no"
frameborder="0"
style="border-bottom:1px grey solid; overflow:hidden; width:292px; height:525px;"
allowTransparency="true">
You could try using the older fan box plugin which offered loading an external CSS file. I don't know if it still works. If so, it could stop working any moment.
You certainly are not the only one with such problems. I suggest you file a feature request / vote for an existing one.
You cannot style pages form other domains.
That would also make XSS possible.

Creating a link for a div

I have a logo in a div and would like to have it link to a home page on click. From my quick search it looks like this could easily be done with css stylesheets. Any other quick way to do it with javascript or jquery or something??
You can't do this with CSS.
You need to use actual markup for the link, and using Javascript with onClick and window.location would just be stupid.
<a href="http://www.myhomepage.com" title="CLick to go to Home">
<img src="/images/logo.png" height=64 width=32 alt="logo" />
</a>
just wrap the image file in an anchor tag? If you are not using an image tag to display the logo, you can use javascript/jquery to leverage the click event of the div to navigate to the link.
Use this:
onClick="parent.location='page.html'

How Stackoverflow has implemented the logic for displaying flags on mouse over of comments

I need logic to display images on mouse over of datagrid in asp.net
If you want to know how SO does it do as Wikser suggests and view the source. If you want help to do something similar then I'll need to know what client side libraries yo are using.
Without having looked at SO source I see an empty space that an image appears in when the mouse is over something else. If I were to recreate this behavior I would do something like this for the HTML:
<img src="..." id="flag" style="visibility: hidden"/>
...
<span id="comment">blah blah blah</span>
and I would use JQuery like this to set up the effect:
$("#comment").hover(
function() {$("#flag").css("visibility", "visible"},
function() {$("#flag").css("visibility", "hidden"});
I suggest try jQuery balloon tips
Here are many examples.
http://www.dreamcss.com/2009/05/12-jquery-tooltip-for-web-developer.html
http://www.webdesignbooth.com/15-jquery-plugins-to-create-an-user-friendly-tooltip/
http://www.lullabot.com/articles/announcing-beautytips-jquery-tooltip-plugin
The logic is that create on fly a cool div set with your informations, and display it on mouse over, in the position you wish.

Resources