Welcome Guest, Not a member yet? Register   Sign In
jQuery Image manipulation
#1

[eluser]Fireclave[/eluser]
Hello, i would to rotate a image (or flip or else) by clicking on a icon. I'm testing jQuery, but it will not work.

Have anyone a snipplet or a other good example to load a method (in model) and exchange the image ?
#2

[eluser]Fireclave[/eluser]
Hi, i made this example to rotate the image. That works fine, but the rotated image will not be shown in the browser. I have the old - unrotate image... Whats wrong.

Code:
<html>
<head>

<title>Simple Ajax Messaging</title>
    

$(document).ready(function() {
    $('#submit').click(function() {
        
        $.ajax({
          url: '<?php echo site_url('message/image/ajax/1169549_53885002.jpg') ?>',
          success: function(data) {
            $('#grafik').attr('src', '<?php echo base_url().'bilder/' ?>'+data);
            
            //alert($('#grafik').attr('src'));
            //alert('Load was performed.');
          }
        });        

    });
});
  
</head>
<body>


<img src="&lt;?php echo base_url().'bilder/1169549_53885002.jpg'?&gt;" width="300" id="grafik" />

<h1>Simple Ajax Messaging</h1>
<div id="form">
    &lt;input type="text" id="message" name="message" /&gt;
    &lt;input type="submit" id="submit" name="submit" value="submit" /&gt;
</div>
<div id="content">
&lt;?php $this->load->view('messages_list') ?&gt;
</div>
&lt;/body&gt;
&lt;/html&gt;

I get the URL of the Picture, that will be rotatad back... from the ajax function any ideas ?
#3

[eluser]Fireclave[/eluser]
have anyone 5 minutes to check my javascript (jquery) code ?
#4

[eluser]danmontgomery[/eluser]
What does "will not work" mean? Have you tried firebug or the javascript error console to do any debugging at all? What was the result of that?
#5

[eluser]Fireclave[/eluser]
the image will rotated, the request is okay too, but the rotated image will not be updated.

// When Image ist rotated, then show the same picture again (reload)
$('#grafik').attr('src', '&lt;?php echo base_url().'bilder/' ?&gt;'+data);

This should update the picture or not ? i load the same image like before.




Theme © iAndrew 2016 - Forum software by © MyBB