Jump to content
  • 0

jQuery attributi


xaero
 Share

Question

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled</title>
</head>

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dragable.js"></script>
<script type="text/javascript" src="dimensions.js"></script>

<script>
$(document).ready(function(){
$('img').dragable({
clone: true,
opacity: 0.5,
renewTarget:true,
over:function(obj,targ){
alert($(targ).attr('src'));

},
drop:function(obj,targ){
alert('pasted');
}
});
});
</script>

<body>

<img src="1.gif">
<img src="2.gif">
<img src="3.gif">
<img src="4.gif">
<img src="5.gif">

<div id="mine">X</div>

</body>
</html>

over:function(obj,targ){
alert($(targ).attr('src'));

},

zdes kak mojno lovit src?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Я вообще не знаю, что такое obj,targ, но один из них — то, что тебе нужно. Получить src можно в зависимости от того, что это за объект, либо DOM либо jQUery. В первом случае obj.src, во втором — obj.attr('src')

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy