开发者

Arrow in jQuery Dialog

Is there any way by which I can show an arrow tip on left of jQuery dialog? I would like to achieve functionality as me开发者_开发问答ntioned in image below. How to do this with Theme roller CSS and icons?

jQuery Dialog Customization http://www.freeimagehosting.net/uploads/74b51bb861.jpg


UPDATE: I posted my first answer BEFORE the edit was made, indicating that arrow was to be placed in the body of the dialog, so here is my updated code:

var $mydialog = $('<div></div>').html('<div class="myArrow"></div>Your Dialog Content Here').dialog({autoOpen: false,title: 'Retrieving Product Details', modal:true, width:600, height:400, position:'center'});

The myArrow div has been moved to the main content div of the dialog, CSS could be something like:

.myArrow{
  display:block;
  position:absolute;
  width:15px;
  height:15px;
  left:-15px; /* pushes the arrow OUTSIDE the box */
  top:50px; /* or however far from the top you wish */
  background: url(path/to/arrow.jpg) center right no-repeat;
  margin:0 15px 0 0;
  }


A simple method would be t simply add the html and / or css into your title attribute when constructing your dialog like so:

var $mydialog = $('<div></div>').html('Your Dialog Content Here').dialog({autoOpen: false,title: '<div class="myArrow"></div>Retrieving Product Details', modal:true, width:600, height:400, position:'center'});

$mydialog.dialog('open'); //triggers dialog open event, can close with ('close')

And the css for myArrow:

.myArrow{
  display:block;
  float:left;
  clear:none;
  width:15px;
  height:15px;
  background: url(path/to/arrow.jpg) center center no-repeat;
  margin:0 15px 0 0; // some maring on the right to push title away from div;
  }

Hope that helps a little

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜