大家好,我搜索了很多,但我找不到解决问题的方法,我正在使用 jQuery mobile,我有一个元素data-role="page" and data-url="link"
现在我的问题是我的元素没有占据屏幕的整个宽度,就像用户放大到最大一样,这就是我想要的。我也设置<meta name="viewport" content="width=device-width, user-scalable=no">
了但没有运气:(
请大家给我一个解决方案。
//LE
<?php get_header(); ?>
<?php $var1 = query_posts('post_type=Home Pages&meta_key=select_column_column&meta_value=Left');?>
<?php if (have_posts($var1)) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php $color = get_post_meta($post->ID,'select_color_color',true); ?>
<article data-role="page" data-transition="slide">
<div class="sprite top-<?=$color?>"></div>
<div class="txt <?=$color?> clearfix">
<?php if(has_post_thumbnail()): ?>
<?php the_post_thumbnail('post-image'); ?>
<?php endif; ?>
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
</div>
<div class="sprite bottom-<?=$color?>"></div>
</article>
<?php endwhile; ?>
<?php endif; wp_reset_query();?>
<?php get_footer(); ?>
$('article').bind("swipeleft", function(){
var nextpage = $(this).next('article[data-role="page"]');
// swipe using id of next page if exists
if (nextpage.length > 0) {
$.mobile.changePage(nextpage, {transition: "slide",
reverse: false}, true, true);
}
$('article').unbind('swipeleft', nextpage);
});
$('article').bind("swiperight", function(){
var prevpage = $(this).prev('article[data-role="page"]');
if (prevpage.length > 0) {
$.mobile.changePage(prevpage, {transition: "slide",
reverse: true}, false, true);
}
$('article').unbind('swiperight', prevpage);
});