[jQuery] Re: ANNOUNCE: zoomi plugin!

2007-06-23 Thread Daemach

Very nice work Sean - that is going to be really useful.

I haven't looked into the border issue you mentioned, but this.width
or this.style.width hold the value of the style= attribute of the
element.  When your node's styles are inherited via a css rule you
need to look for the computed style.  When I get some time I'm going
to redo my css helper library and release it, but this snippet will
get you going:

camelCase: function(s){
if (s == float){ return cssFloat; };
for(var str=/-([a-z])/; str.test(s); 
s=s.replace(str,RegExp.
$1.toUpperCase()));
return s;
},
getComputedStyle: function(ele,attr){
attr = this.camelCase(attr);
if (ele.currentStyle){
return ele.currentStyle[attr];
} else if (window.getComputedStyle){
return window.getComputedStyle(ele,null)[attr];
}
return null;
}

On Jun 23, 2:33 pm, Sean Catchpole [EMAIL PROTECTED] wrote:
 Another weekend, another plugin =P

 zoomi:http://www.sunsean.com/zoomi/

 So here's the scoop. It's almost ready, beta as some people call it.
 I'm releasing as beta because I want your input on a feature... and
 there is still one more bug.

 The feature I'm wondering about, is if the zoom2 image should inherit
 the classes of the original image. (If what I'm saying makes no sense,
 go view the source code of the zoomi page above)

 The only bug is that if there is a border around the zoom2 image using
 css, then it won't be in the right spot. I've run into a interesting
 problem, I can't get the styles from the css file. Check out the
 example of this problem here:http://www.sunsean.com/styletest/If
 anyone knows the answer please let me know.

 Enjoy ^_^

 ~Sean



[jQuery] Re: ANNOUNCE: zoomi plugin!

2007-06-23 Thread Daemach

Erg - I hit send too soon...

If you look at document.styleSheets[0].cssRule[4].style.borderTop in
the Firebug DOM tab, it looks like it should be returning a value for
that attribute.  I can't tell you why it doesn't at the moment, but if
you query borderTopWidth, borderTopColor, or borderTopStyle they
return the correct values.


  $(function(){
$(.box).each(function(){
  var str =width:  + getComputedStyle(this,width) + br/;
  str+=margin-top:  + getComputedStyle(this,marginTop) + br/
;
  str+=border-top:  + getComputedStyle(this,borderTopWidth) +
br/;
  str+=border-top:  + getComputedStyle(this,borderTopColor) +
br/;
  str+=border-top:  + getComputedStyle(this,borderTopStyle) +
br/;
  $(this).html(str);
});
  });



On Jun 23, 2:33 pm, Sean Catchpole [EMAIL PROTECTED] wrote:
 Another weekend, another plugin =P

 zoomi:http://www.sunsean.com/zoomi/

 So here's the scoop. It's almost ready, beta as some people call it.
 I'm releasing as beta because I want your input on a feature... and
 there is still one more bug.

 The feature I'm wondering about, is if the zoom2 image should inherit
 the classes of the original image. (If what I'm saying makes no sense,
 go view the source code of the zoomi page above)

 The only bug is that if there is a border around the zoom2 image using
 css, then it won't be in the right spot. I've run into a interesting
 problem, I can't get the styles from the css file. Check out the
 example of this problem here:http://www.sunsean.com/styletest/If
 anyone knows the answer please let me know.

 Enjoy ^_^

 ~Sean



[jQuery] Re: ANNOUNCE: zoomi plugin!

2007-06-23 Thread Daemach

Here's an even better way :)

str+=border-top-style:  + $(this).css(borderTopStyle) + br/;


On Jun 23, 2:33 pm, Sean Catchpole [EMAIL PROTECTED] wrote:
 Another weekend, another plugin =P

 zoomi:http://www.sunsean.com/zoomi/

 So here's the scoop. It's almost ready, beta as some people call it.
 I'm releasing as beta because I want your input on a feature... and
 there is still one more bug.

 The feature I'm wondering about, is if the zoom2 image should inherit
 the classes of the original image. (If what I'm saying makes no sense,
 go view the source code of the zoomi page above)

 The only bug is that if there is a border around the zoom2 image using
 css, then it won't be in the right spot. I've run into a interesting
 problem, I can't get the styles from the css file. Check out the
 example of this problem here:http://www.sunsean.com/styletest/If
 anyone knows the answer please let me know.

 Enjoy ^_^

 ~Sean



[jQuery] Re: ANNOUNCE: zoomi plugin!

2007-06-23 Thread Su

This is neat.

On 6/23/07, Sean Catchpole [EMAIL PROTECTED] wrote:


The feature I'm wondering about, is if the zoom2 image should inherit
the classes of the original image. (If what I'm saying makes no sense,
go view the source code of the zoomi page above)



Would it be a pain to make it optional? I ran into this decision when
working on my figures plugin[1], and ended up deciding that whether it was
needed or not was really going to depend upon the user and how their styling
was worked out.

I do have one fairly big objection, though: Your usage of the alt attribute
for the zoomed image is inappropriate and interferes with accessibility.
Using a filename for alt text is considered unacceptable, not to mention
that since you're having it refer to /another/ image, it's just plain wrong.
Why not have Zoomi just look for something like original-filename_zoomed.ext
or something? It would actually cut down on work for the user, for that
matter.


[1] http://pioindustries.com/projects/jquery/figures  --See the strip
argument.


[jQuery] Re: ANNOUNCE: zoomi plugin!

2007-06-23 Thread Benjamin Sterling

I agree with Su, you may be able to get away with using src and lowsrc, but
I am not totally sure what browsers are fully supporting lowsrc.

On 6/23/07, Su [EMAIL PROTECTED] wrote:


This is neat.

On 6/23/07, Sean Catchpole [EMAIL PROTECTED] wrote:

 The feature I'm wondering about, is if the zoom2 image should inherit
 the classes of the original image. (If what I'm saying makes no sense,
 go view the source code of the zoomi page above)


Would it be a pain to make it optional? I ran into this decision when
working on my figures plugin[1], and ended up deciding that whether it was
needed or not was really going to depend upon the user and how their styling
was worked out.

I do have one fairly big objection, though: Your usage of the alt
attribute for the zoomed image is inappropriate and interferes with
accessibility. Using a filename for alt text is considered unacceptable, not
to mention that since you're having it refer to /another/ image, it's just
plain wrong.
Why not have Zoomi just look for something like
original-filename_zoomed.ext or something? It would actually cut down on
work for the user, for that matter.


[1] http://pioindustries.com/projects/jquery/figures  --See the strip
argument.





--
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com