Tuesday, February 24, 2009

Re: Submit using image

Hey,

The method I use workds really well on all browsers, and is achieved with
CSS:

.save_btn {
background: #fff url(../img/myimage.png) top left no-repeat;
width: 70px;
height: 20px;
padding-top: 20px;
overflow: hidden;
}

If your image is a 70 pixel by 20 pixel button for a single sprite, this
essentially shows the backgorund image in place, while hiding overflow, and
pushing your text outside its display area. This is also a useful image
replacement technique for headings and such too.

Give it a go, and let me know how it works out.

Cheers,
Graham Weldon.

On Tue, 24 Feb 2009 18:56:47 -0800 (PST), WidePixels <dave@widepixels.com>
wrote:
> What I have been trying to do is use an image to submit the AJAX form.
> Thing is I am using a CSS sprite as the image so i have the hover and
> other button states in the CSS. the actual image(s) are in the CSS and
> not physically linked to the submit. I have the class added fine to
> the submit link, but the 'SAVE' text shows up over my CSS button.
>
> So basically i need to have the $caption for the link not display.
>
> link:
> <?php echo $ajax->submit('save', array(
> 'url' =>'.....',
> 'update' => '......',
> 'class' => 'save_btn',
> 'loading'=> '........',
> 'complete' => '..........'
> ));?>
>
> Ideas, suggestions?
>
> Thanks,
> Dave
>
--
Cheers,

Graham Weldon
w. http://grahamweldon.com
e. graham@grahamweldon.com
p. +61 407 017 293

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: