JQuery Driven Sliders/Animaters & Cell Phones
Cell phones are used by consumers for internet activity more and more. It makes sense to develop and use scripts for functions that will behave consistently whether they are viewed on a computer or a cell phone. I came across a Jquery plug in for sliders/animators that does just that. It works with one of the most popular image gallery plug ins, jQuery Cycle PluginA code snippet is included below. When the italic portion of the script “.touchswipe” is incorporated, then cell phone (Android and IPhone) users have the choice of using either the built in user navigation controls or they can also choose to use the touch/swipe technology built into their cell phones.
$(document).ready(function() {
$('#imagegallery').cycle({
fx: 'scrollHorz'
});
$(“#imagegallery”).touchwipe({
wipeLeft: function() {
$(“#imagegallery”).cycle(“next”);
},
wipeRight: function() {
$(“#imagegallery”).cycle(“prev”);
}
});
});
More information is available here: http://archive.plugins.jquery.com/project/Touchwipe-iPhone-iPad-wipe-gesture
Read MoreJQuery Offset Function
I ran into an issue while working with a script for a navigation menu. It uses options for adjusting subnavigation positioning right within the script.
No matter what css or script changes I tried, the subnavigation menus kept drifting to the right. They also drifted differently in Firefox than they did in all other browsers.
A positioning element like the snippet you see below can work with either the “offset” or “position”. This offers the option to position elements relative to parent position or the edge of the browser window for things like subnavigation menus.
mm_item_content_obj.css({
‘top’: ($mm_item_link.position().top + $mm_item_link.outerHeight()) + 3 +”px”,
‘left’: ($mm_item_link.position().left) – 0 + ‘px’
})
This is great for having additional flexibility for positioning items that are script driven. This issue? It was reading a width assigned in the stylesheet for the body tag. The body tag is often used to set site content width. However some Jquery powered scripts pick up on width attributes specified in the body tag and take them into consideration when calculating. Once the width was removed from the body tag, it behaved exactly as expected in all browsers.
More information is available here: http://api.jquery.com/offset/
Read MoreWorking with SubSonic: How to do an In query on a list of Ids
Start with a list of ids
1 2 3 4 5 6 7 8 | List<string> lstFootNoteIds = null; if (!string.IsNullOrEmpty(_SvcPartApp.FootNoteIdList)) { lstFootNoteIds = new List<string>(_SvcPartApp.FootNoteIdList.Split(';')); } W2MDciFootNoteCollection footNotes = new Select().From("W2M_DCI_FootNotes") .Where("FNId").In(lstFootNoteIds).ExecuteAsCollection<W2MDciFootNoteCollection>(); |
It takes any list that inherits from IEnumerable and searches for an id in the list
Read MoreWorking with SubSonic: Delete
1 2 | new Delete().From("W2M_ProductGroups").Where("ProductId").IsEqualTo(_ProductId) .Execute(); |
Recent Comments