You are here

请问关于ctools的modal效果的参数问题

流云 的头像
Submitted by 流云 on 星期一, 2013-03-04 03:10

我参照ctools给的例子写了一个modal的测试,效果是出来了,但是发现窗口的控制参数,比如宽度高度最后没有作用在窗口上,我去看了下它给的例子效果页面: ctools_ajax_sample 列出的效果,发现也是一样,我直接给它改了宽度,但最后呈现的窗口还是几乎和网站宽度一样,不知这是个bug还是需要注意其它地方呢?请问我该怎么正确控制窗口的参数呢?

论坛:

Drupal版本:

流云 的头像

 

多谢老葛!我对比了下,发现是一个参数的传递作用的,这下明白了 
$links[] = ctools_modal_text_button(t('Modal Login (default style)'), 'ctools_ajax_sample/nojs/login', t('Login via modal'));
 
    // The extra class points to the info in ctools-sample-style which we added
    // to the settings, prefixed with 'ctools-modal'.
    $links[] = ctools_modal_text_button(t('Modal Login (custom style)'), 'ctools_ajax_sample/nojs/login', t('Login via modal'),  'ctools-modal-ctools-sample-style');
 
我们定义好的那个modal格式名(如:ctools-modal-ctools-sample-style),要传过去才行。