Skip to main content

Posts

FancyBox iFrame broke after Tables & Styles in IE

I'm wondering if there's any particular rules regarding using and stylizing 'fancybox' windows. I've implemented a 'fancybox' using the iFrame call - and when I just had some simple text, a background color, and an Image; it rendered great IE 6+. BUT, now that I've added a simple table with some styles for buttons within - it breaks in 6/7. Anything particular I should avoid implementing and putting inside an iFrame called .html while using fancybox supporting IE6/7? ! Update (please help me debug - here's what I have being called in the fancybox via iFrame): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> <style> h1 { font-famil

Send custom message from iframe guest to iframe host where host HTML from portlet

I'm trying to send a custom message from an iframe guest to an iframe host using jQuery (We are developing both guest and host). The guest and host are on the same domain but on different ports. Also, the iframe host is being rendered from a portlet within a Liferay portal instance (5.2.3) and the portal mangles the host URL of the portlet. The host and guest URLs look like: host: http://localhost:8080/host/foo/bar?p_p_id=portletname_WAR_portletname_INSTANCE_nNz9&... guest: http://localhost:8081/guest I know that trying to do this messaging violates the same origin policy enforced by browsers. To get around this I've looked at using PortHole, EasyXDM and the jquery-postmessage-plugin. The problem I have is this: For these libraries to work the sender (iframe guest) needs to know the host url but cannot know the mangled portlet host url in advance.

Open new tab in Chrome extensions

I'm trying to write a simple google extension that will upon clicking "ctrl+alt+x" search for the selected text in google. This is my mainfest: { "name": "A jQuery Chrome extension", "version": "0.1", "description": "Use jQuery to build Chrome extensions", "content_scripts": [ { "matches" : ["http://*/*"], "js": ["jquery.js", "jquery.hotkeys.js", "content.js"] } ], "background_page": "background.html", "permissions": [ "tabs" ] } And this is my content.js: $(document).bind('keydown', 'alt+ctrl+x', function() { var selectedText = window.getSelection().toString(); if (selectedText) { var googleQuery = "http://www.google.com/search?q=" + selectedText; alert(googleQuery); chrome.tabs.create({"url

How can I highlight search terms using animated color change

I have a word cloud and I want to pick a few unique pre-defined words from it and smoothly change their color. Basically I want to do this, // font color animation $(".second a").hover(function() { $(this).animate({ color: "#00eeff" }, 400); },function() { $(this).animate({ color: "#FFFFFF" }, 500); }); but instead of hover being the trigger I just want to have a setTimeout function trigger the change. How can I do that? Any help will be greatly appreciated

function is setting all instead of each

I have a simple function that sets the width of a bar based on an argument. And I call the function on .each with jQuery. The console logs the statement correctly, showing me it seems to work. However, the style seems to be overridden by the last value found. Here is the function: function barGraph(innerWidth, barWidth) { innerWidth = parseInt(innerWidth) * .01 || .50; barWidth = parseInt(barWidth) || 267; // find percentage of total width var innerWidth = Math.floor(innerWidth * barWidth); var $innerBar = $('.slider-box div'); $innerBar.css('width', innerWidth + 'px'); console.log("Width should be: " + innerWidth + 'px'); } then i call the function on each with jQuery: $(document).ready(function() { var $innerBar = $('.slider-box div'); $innerBar.each(function(index) { var newWidth = $(this).attr("data-bar-width"); barGraph(newWidth, 267); }); }); the console log shows

prettyPhoto, &ldquo;title&rdquo; and tooltips

In prettyPhoto, how can I have the photo description come from something other than "title" (added to <a> tag surrounding the <img>)? When hovering over the image, it displays ugly html on my website that I only want to be seen and displayed by prettyPhoto when it opens (hence it contains html), but not as a tooltip. One thought I had was to plug into an event but the only one relevant is changepicturecallback, and I can't figure out how to access the current photo element from that. Maybe it's something in jQuery itself but I'm a little lost as to where to find it. Any idea would help. Thanks, Igor