Click the subtitle of navigation bar (subtitleClick
) to trigger callback.
Use subtitleClick interface
document.addEventListener('subtitleClick', function (e) {
alert('subtitle clicked')
}, false);
Code sample
The following code sample demonstrates the basic functions:
<h1>Please click the subtitle to see effect </h1>
<script>
document.addEventListener('subtitleClick', function(e) {
alert('subtitle clicked')
}, false);
function ready(callback) {
// Call directly if JSBridge has been injected
if (window.AlipayJSBridge) {
callback && callback();
} else {
// Monitor the injected events if JSBridge hasn't been injected
document.addEventListener('AlipayJSBridgeReady', callback, false);
}
}
ready(function() {
AlipayJSBridge.call('setTitle', {
title: 'Title',
subtitle: 'Subtitle'
});
});
</script>