How to make embed code using jquery and html?
I like to 开发者_StackOverflowcreate an link image and i need to popup my feedback window once user clciks that image icon in his website. how can i deliver image link icon through embed code(Functionality is once image icon clicked popup window opens with my feedback page)
Now i am using(Sample codes)...
<div>
<link href="thickbox.css" rel="stylesheet" type="text/css" />
<script src="jquery.js" type="text/javascript"></script>
<script src="thickbox.js" type="text/javascript"></script>
<a id="feedback" onclick="tb_show('Feedback', 'http://myfeedbackpage.com/&keepThis=true&TB_iframe=1&width=1000&height=400&model=true');" href="javascript: void(0);"><img src="feedback.jpg" width="29" height="31" alt="feedback" style="vertical-align:bottom" /></a>
</div>
I am using thick box for popup. Help me how to simplify these codes as embed codes
I think you're asking how to move your onclick
property into a separate file. First, change the HTML to just:
<a id="feedback" href="#"><img src="feedback.jpg" width="29" height="31" alt="feedback" style="vertical-align:bottom" /></a>
Then in your JavaScript file write:
$(document).ready(function() {
$("#feedback").click(function() {
tb_show('Feedback', 'http://myfeedbackpage.com/&keepThis=true&TB_iframe=1&width=1000&height=400&model=true');
});
});
精彩评论