Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: gh-pages
Fetching contributors…

Cannot retrieve contributors at this time

96 lines (91 sloc) 3.24 kb
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Javascript image dropdown</title>
<link rel="stylesheet" href="examples/css/sample.css" />
<script src="js/jquery/jquery-1.8.2.min.js"></script>
<!-- <msdropdown> -->
<link rel="stylesheet" type="text/css" href="css/msdropdown/dd.css" />
<script src="js/msdropdown/jquery.dd.min.js"></script>
<!-- </msdropdown> -->
<link rel="stylesheet" type="text/css" href="css/msdropdown/skin2.css" />
<link rel="stylesheet" type="text/css" href="css/msdropdown/flags.css" />
</head>
<body>
<table width="100%" border="0" cellspacing="1" cellpadding="5" class="topmenu">
<tr>
<td colspan="2" class="top"><h1>
<a href="http://www.marghoobsuleman.com/blog/jquery-image-dropdown">
Forked from Marghoob Suleman's Javascript image dropdown (v3.2)
</a></h1></td>
</tr>
</table>
<form action="/foo" method="post" enctype="multipart/form-data" name="frmdata">
<table width="100%" border="0" cellspacing="1" cellpadding="5" class="tblWhite">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td valign="top"><h3>Created from HTML SELECT Element</h3></td>
</tr>
<tr>
<td valign="top">
<select id="payments" name="payments" style="width:250px;">
<option value=""
data-description="Choos your payment gateway">Payment Gateway</option>
<option value="amex"
data-image="images/msdropdown/icons/Amex-56.png"
data-description="My life. My card...">Amex</option>
<option value="Discover"
data-image="images/msdropdown/icons/Discover-56.png"
data-description="It pays to Discover...">Discover</option>
<option value="Mastercard"
data-image="images/msdropdown/icons/Mastercard-56.png"
data-title="For everything else..."
data-description="For everything else...">Mastercard</option>
<option value="cash"
data-image="images/msdropdown/icons/Cash-56.png"
data-description="Sorry not available..."
disabled="true">Cash on devlivery</option>
<option value="Visa"
data-image="images/msdropdown/icons/Visa-56.png"
data-description="All you need...">Visa</option>
<option value="Paypal"
data-image="images/msdropdown/icons/Paypal-56.png"
data-description="Pay and get paid...">Paypal</option>
</select> &nbsp;
</td>
</tr>
<tr>
<td>
Blah blah blah ...
</td>
</tr>
</table>
</form>
<script>
$(document).ready(function(e) {
//no use
try {
var pages = $("#pages").msDropdown({on:{change:function(data, ui) {
var val = data.value;
if(val!="")
window.location = val;
}}}).data("dd");
var pagename = document.location.pathname.toString();
pagename = pagename.split("/");
pages.setIndexByValue(pagename[pagename.length-1]);
} catch(e) {
//console.log(e);
}
//convert
$("select").msDropdown();
createByJson();
});
function showValue(h) {
console.log(h.name, h.value);
}//
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.