Category ArchivejQuery
Category ArchivejQuery
jQuery & Internet & Programming Daantje on 26 Aug 2011
It’s a little jquery patch I wrote after I found this post. I think this works better…. and in all browsers… Just copy it somewhere after the DOM is ready. (jquery.ready())
What the problem is; :hover is a css pseudo selector, but a event state in Javascript. (Or some thing like that…) So it only gives the right color on mouse over. Only than the selector is valid.
The fix is simple; rebuild the element on mouse over, so you find the right color. The rebuild has only to be done the first time you role over it. And after reading the Typeface-js source, I found the render method hack to fix the un-rendered text element in the new color. Done is my mesh up. Have fun with it.
$(".typeface-js a,a.typeface-js").hover(
function(){
if(!$(this).hasClass('typeface-js-hover-checked')){
$(this).wrapInner('<span class="typeface-js-normal"></span>').append($('<span class="typeface-js-hover"></span>').text($(this).text()).css('color',$(this).css('color'))).addClass('typeface-js-hover-checked');
_typeface_js.renderDocument();
}
$(this).find('.typeface-js-normal').hide();
$(this).find('.typeface-js-hover').show();
},
function(){
$(this).find('.typeface-js-normal').show();
$(this).find('.typeface-js-hover').hide();
}
);
jQuery & Fun & Programming Daantje on 08 Apr 2011
I’ve made my first jQuery plugin :) It’s called jSpeaker. It will read text that’s within a selected object. It uses the google translate speak/listen function. Check the jquery plugin page or the project page form more info, samples and documentation.
jQuery & PHP & Programming Daantje on 10 Jun 2009
I’m now busy with writing a filter, to grep data out of an large based HTML website, build back in the old days. Luckily they’ve used class names to point out the right table cells. I thought it would be a great job for jquery… But server-side… Could it be possible?
After some googling I found this very interesting blog post: “Bringing the Browser to the Server“. A real great way to use a javascript lib like jquery or prototype server side!
I use PHP to grep the HTML and transfer it to valid XHTML so I can use it in rhino.
./html2xml.php [path/to/file.html]
#!/usr/bin/php -q
<?php
$doc = new DOMDocument();
$doc->loadHTMLFile($argv[1]);
$html = $doc->saveXML();
$html = str_replace('<script','<noscript',$html);
$html = str_replace('</script','</noscript',$html);
echo $html;
?>
Than I use jquery to grep all data and do an ajax request to a PHP file to insert the data into a database.
After some testing, my scripts only work wit an older version of jquery. I use 1.2.6, the later ones all give errors…
I’ll try to post more info and code later ;) Check my tweets for info too!
Purchase Cheap Oem Adobe Flash Professional Cs5 In German
Buy Microsoft Windows 7 Ultimate Sp1 Online Microsoft Office 2010 Visio Premium Online Purchase Adobe Dreamweaver Cs5 Online Oem Adobe Dreamweaver Cs5 In German Online Purchase Microsoft Windows Vista Ultimate Sp1 Online Purchase Discounted Microsoft Office 2008 For Mac Online Purchase Adobe Creative Suite 4 Design Premium Buy Cheap Adobe Photoshop Lightroom 3.2 In German Online Buy Cheap Adobe Photoshop Cs3 ExtendedBuy Cheap Oem Microsoft Office 2004 Pro For Mac
Buy Discounted Oem Adobe Creative Suite 5.5 Master Collection
Purchase Discounted Oem Microsoft Office 2003 Professional Edition Purchase Cheap Adobe Photoshop Cs3 Extended Online Cheap Oem Adobe Fireworks Cs4 For Mac Discounted Oem Adobe Acrobat 8 Pro For Mac Online Purchase Discounted Adobe Creative Suite 5.5 Master Collection Multilanguage Online Purchase Cheap Adobe Premiere Pro Cs5.5 Online